「Xamarin.Macでリムーバブルメディアの着脱を検知する」の版間の差分

imported>Administrator
編集の要約なし
imported>Administrator
編集の要約なし
11行目: 11行目:
<source lang="csharp">
<source lang="csharp">
     using System;
     using System;
     using MonoMac.Foundation;
     using Foundation;
     using MonoMac.AppKit;
     using AppKit;


     public class RemovableMediaNotificationEventArgs : EventArgs
     public class RemovableMediaNotificationEventArgs : EventArgs
52行目: 52行目:
             if (_mountObserver == null)
             if (_mountObserver == null)
             {
             {
                 _mountObserver = notification.AddObserver("NSWorkspaceDidMountNotification", DidMount);
 
                 _mountObserver = notification.AddObserver(NSWorkspace.DidMountNotification, DidMount);
             }
             }


58行目: 59行目:
             if (_unmountObserver == null)
             if (_unmountObserver == null)
             {
             {
                 _unmountObserver = notification.AddObserver("NSWorkspaceWillUnmountNotification", WiilUnmount);
 
                 _unmountObserver = notification.AddObserver(NSWorkspace.WillUnmountNotification, WiilUnmount);
             }
             }
         }
         }
111行目: 113行目:


             var workspace = NSWorkspace.SharedWorkspace;
             var workspace = NSWorkspace.SharedWorkspace;
             workspace.GetFileSystemInfo(devicePath, out isRemovable, out isWritable,out isUnmountable, out description, out fileSystemType);
             workspace.GetFileSystemInfo(devicePath, out isRemovable, out isWritable, out isUnmountable, out description, out fileSystemType);


             var args = new RemovableMediaNotificationEventArgs {
             var args = new RemovableMediaNotificationEventArgs
            {
                 DevicePath = devicePath,
                 DevicePath = devicePath,
                 IsRemovable = isRemovable,
                 IsRemovable = isRemovable,
126行目: 129行目:
</source>
</source>


==関連項目==
== 関連項目 ==
*[[Xamarin.Mac/CDやDVDなどの光学メディアを排出する]]
*[[Xamarin.Mac/CDやDVDなどの光学メディアを排出する]]
==参考文献==
{{reflist}}
{{stub}}


[[category:MonoMac]]
[[category:MonoMac]]
[[category:Xamarin.Mac]]
[[category:Xamarin.Mac]]