mirror of
https://gitee.com/csharpui/CPF.git
synced 2025-07-17 10:42:00 +08:00
32 lines
631 B
C#
32 lines
631 B
C#
![]() |
using CPF.Mac.ObjCRuntime;
|
||
|
using System;
|
||
|
|
||
|
namespace CPF.Mac.Foundation
|
||
|
{
|
||
|
[Register("__MonoMac_NSActionDispatcher")]
|
||
|
internal sealed class NSActionDispatcher : NSObject
|
||
|
{
|
||
|
public const string SelectorName = "xamarinApplySelector";
|
||
|
|
||
|
public static readonly Selector Selector = new Selector("xamarinApplySelector");
|
||
|
|
||
|
private readonly NSAction action;
|
||
|
|
||
|
public NSActionDispatcher(NSAction action)
|
||
|
{
|
||
|
if (action == null)
|
||
|
{
|
||
|
throw new ArgumentNullException("action");
|
||
|
}
|
||
|
this.action = action;
|
||
|
}
|
||
|
|
||
|
[Export("xamarinApplySelector")]
|
||
|
[Preserve(Conditional = true)]
|
||
|
public void Apply()
|
||
|
{
|
||
|
action();
|
||
|
}
|
||
|
}
|
||
|
}
|