mirror of
https://gitee.com/csharpui/CPF.git
synced 2025-04-05 17:37:51 +08:00
41 lines
804 B
C#
41 lines
804 B
C#
using CPF.Mac.ObjCRuntime;
|
|
using System;
|
|
|
|
namespace CPF.Mac.Foundation
|
|
{
|
|
[Register("NSAutoreleasePool", true)]
|
|
public class NSAutoreleasePool : NSObject, IDisposable
|
|
{
|
|
public override IntPtr ClassHandle => Class.GetHandle("NSAutoreleasePool");
|
|
|
|
[Export("init")]
|
|
public NSAutoreleasePool()
|
|
: base(NSObjectFlag.Empty)
|
|
{
|
|
if (IsDirectBinding)
|
|
{
|
|
base.Handle = Messaging.intptr_objc_msgSend(base.Handle, Selector.GetHandle("init"));
|
|
}
|
|
else
|
|
{
|
|
base.Handle = Messaging.intptr_objc_msgSendSuper(base.SuperHandle, Selector.GetHandle("init"));
|
|
}
|
|
}
|
|
|
|
public NSAutoreleasePool(NSObjectFlag t)
|
|
: base(t)
|
|
{
|
|
}
|
|
|
|
public NSAutoreleasePool(IntPtr handle)
|
|
: base(handle)
|
|
{
|
|
}
|
|
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
base.Dispose(disposing);
|
|
}
|
|
}
|
|
}
|