mirror of
https://gitee.com/csharpui/CPF.git
synced 2025-09-19 18:22:30 +08:00
初始化
This commit is contained in:
68
CPF.Mac/Mac/Foundation/NSEnumerator.cs
Normal file
68
CPF.Mac/Mac/Foundation/NSEnumerator.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
using CPF.Mac.ObjCRuntime;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace CPF.Mac.Foundation
|
||||
{
|
||||
[Register("NSEnumerator", true)]
|
||||
public class NSEnumerator : NSObject
|
||||
{
|
||||
private static readonly IntPtr selNextObjectHandle = Selector.GetHandle("nextObject");
|
||||
|
||||
private static readonly IntPtr class_ptr = Class.GetHandle("NSEnumerator");
|
||||
|
||||
public override IntPtr ClassHandle => class_ptr;
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
[Export("init")]
|
||||
public NSEnumerator()
|
||||
: 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 NSEnumerator(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 NSEnumerator(NSObjectFlag t)
|
||||
: base(t)
|
||||
{
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Advanced)]
|
||||
public NSEnumerator(IntPtr handle)
|
||||
: base(handle)
|
||||
{
|
||||
}
|
||||
|
||||
[Export("nextObject")]
|
||||
public virtual NSObject NextObject()
|
||||
{
|
||||
if (IsDirectBinding)
|
||||
{
|
||||
return Runtime.GetNSObject(Messaging.IntPtr_objc_msgSend(base.Handle, selNextObjectHandle));
|
||||
}
|
||||
return Runtime.GetNSObject(Messaging.IntPtr_objc_msgSendSuper(base.SuperHandle, selNextObjectHandle));
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user