差分

ナビゲーションに移動 検索に移動

Xamarin.Macでリムーバブルメディアの着脱を検知する

42 バイト除去, 2018年1月23日 (火) 03:13
編集の要約なし
<source lang="csharp">
using System;
using MonoMac.Foundation; using MonoMac.AppKit;
public class RemovableMediaNotificationEventArgs : EventArgs
if (_mountObserver == null)
{
  _mountObserver = notification.AddObserver("NSWorkspaceDidMountNotification"NSWorkspace.DidMountNotification, DidMount);
}
if (_unmountObserver == null)
{
  _unmountObserver = notification.AddObserver("NSWorkspaceWillUnmountNotification"NSWorkspace.WillUnmountNotification, WiilUnmount);
}
}
var workspace = NSWorkspace.SharedWorkspace;
workspace.GetFileSystemInfo(devicePath, out isRemovable, out isWritable,out isUnmountable, out description, out fileSystemType);
var args = new RemovableMediaNotificationEventArgs {
DevicePath = devicePath,
IsRemovable = isRemovable,
</source>
==関連項目==
*[[Xamarin.Mac/CDやDVDなどの光学メディアを排出する]]
 
==参考文献==
{{reflist}}
 
{{stub}}
[[category:MonoMac]]
[[category:Xamarin.Mac]]
匿名利用者

案内メニュー