CPF/CPF.Mac/Mac/AppKit/NSSoundDelegate.cs
2023-11-21 23:05:03 +08:00

61 lines
1.4 KiB
C#

using CPF.Mac.Foundation;
using CPF.Mac.ObjCRuntime;
using System;
using System.ComponentModel;
namespace CPF.Mac.AppKit
{
[Register("NSSoundDelegate", true)]
[Model]
public class NSSoundDelegate : NSObject
{
[EditorBrowsable(EditorBrowsableState.Advanced)]
[Export("init")]
public NSSoundDelegate()
: base(NSObjectFlag.Empty)
{
if (IsDirectBinding)
{
base.Handle = Messaging.IntPtr_objc_msgSend(base.Handle, Selector.Init);
}
else
{
base.Handle = Messaging.IntPtr_objc_msgSendSuper(base.SuperHandle, Selector.Init);
}
}
[EditorBrowsable(EditorBrowsableState.Advanced)]
[Export("initWithCoder:")]
public NSSoundDelegate(NSCoder coder)
: base(NSObjectFlag.Empty)
{
if (IsDirectBinding)
{
base.Handle = Messaging.IntPtr_objc_msgSend_IntPtr(base.Handle, Selector.InitWithCoder, coder.Handle);
}
else
{
base.Handle = Messaging.IntPtr_objc_msgSendSuper_IntPtr(base.SuperHandle, Selector.InitWithCoder, coder.Handle);
}
}
[EditorBrowsable(EditorBrowsableState.Advanced)]
public NSSoundDelegate(NSObjectFlag t)
: base(t)
{
}
[EditorBrowsable(EditorBrowsableState.Advanced)]
public NSSoundDelegate(IntPtr handle)
: base(handle)
{
}
[Export("sound:didFinishPlaying:")]
public virtual void DidFinishPlaying(NSSound sound, bool finished)
{
throw new You_Should_Not_Call_base_In_This_Method();
}
}
}