mirror of
https://gitee.com/csharpui/CPF.git
synced 2025-09-19 10:08:26 +08:00
初始化
This commit is contained in:
52
CPF.Mac/Mac/AppKit/NSWorkspaceMountEventArgs.cs
Normal file
52
CPF.Mac/Mac/AppKit/NSWorkspaceMountEventArgs.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using CPF.Mac.Foundation;
|
||||
using CPF.Mac.ObjCRuntime;
|
||||
using System;
|
||||
|
||||
namespace CPF.Mac.AppKit
|
||||
{
|
||||
public class NSWorkspaceMountEventArgs : NSNotificationEventArgs
|
||||
{
|
||||
private static IntPtr k0;
|
||||
|
||||
private static IntPtr k1;
|
||||
|
||||
public string VolumeLocalizedName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (k0 == IntPtr.Zero)
|
||||
{
|
||||
k0 = Dlfcn.GetIntPtr(Libraries.AppKit.Handle, "NSWorkspaceVolumeLocalizedNameKey");
|
||||
}
|
||||
IntPtr intPtr = base.Notification.UserInfo.LowlevelObjectForKey(k0);
|
||||
if (intPtr == IntPtr.Zero)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return NSString.FromHandle(intPtr);
|
||||
}
|
||||
}
|
||||
|
||||
public NSUrl VolumeUrl
|
||||
{
|
||||
get
|
||||
{
|
||||
if (k1 == IntPtr.Zero)
|
||||
{
|
||||
k1 = Dlfcn.GetIntPtr(Libraries.AppKit.Handle, "NSWorkspaceVolumeURLKey");
|
||||
}
|
||||
IntPtr intPtr = base.Notification.UserInfo.LowlevelObjectForKey(k1);
|
||||
if (intPtr == IntPtr.Zero)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return (NSUrl)Runtime.GetNSObject(intPtr);
|
||||
}
|
||||
}
|
||||
|
||||
public NSWorkspaceMountEventArgs(NSNotification notification)
|
||||
: base(notification)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user