mirror of
https://gitee.com/csharpui/CPF.git
synced 2025-09-19 01:58:20 +08:00
初始化
This commit is contained in:
49
CPF.Mac/Mac/AppKit/NSPopoverCloseEventArgs.cs
Normal file
49
CPF.Mac/Mac/AppKit/NSPopoverCloseEventArgs.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using CPF.Mac.Foundation;
|
||||
using CPF.Mac.ObjCRuntime;
|
||||
using System;
|
||||
|
||||
namespace CPF.Mac.AppKit
|
||||
{
|
||||
public class NSPopoverCloseEventArgs : NSNotificationEventArgs
|
||||
{
|
||||
private static IntPtr k0;
|
||||
|
||||
public NSPopoverCloseReason Reason
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_Reason == NSPopover.CloseReasonStandard)
|
||||
{
|
||||
return NSPopoverCloseReason.Standard;
|
||||
}
|
||||
if (_Reason == NSPopover.CloseReasonDetachToWindow)
|
||||
{
|
||||
return NSPopoverCloseReason.DetachToWindow;
|
||||
}
|
||||
return NSPopoverCloseReason.Unknown;
|
||||
}
|
||||
}
|
||||
|
||||
internal NSString _Reason
|
||||
{
|
||||
get
|
||||
{
|
||||
if (k0 == IntPtr.Zero)
|
||||
{
|
||||
k0 = Dlfcn.GetIntPtr(Libraries.AppKit.Handle, "NSPopoverCloseReasonKey");
|
||||
}
|
||||
IntPtr intPtr = base.Notification.UserInfo.LowlevelObjectForKey(k0);
|
||||
if (intPtr == IntPtr.Zero)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return (NSString)Runtime.GetNSObject(intPtr);
|
||||
}
|
||||
}
|
||||
|
||||
public NSPopoverCloseEventArgs(NSNotification notification)
|
||||
: base(notification)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user