Ejemplo n.º 1
0
 static void drivedisconnected_cb(IntPtr volume_monitor, IntPtr drive)
 {
     try {
         VolumeMonitor volume_monitor_managed = GLib.Object.GetObject(volume_monitor, false) as VolumeMonitor;
         volume_monitor_managed.OnDriveDisconnected(GLib.DriveAdapter.GetObject(drive, false));
     } catch (Exception e) {
         GLib.ExceptionManager.RaiseUnhandledException(e, false);
     }
 }
Ejemplo n.º 2
0
 static void volumeadded_cb(IntPtr volume_monitor, IntPtr volume)
 {
     try {
         VolumeMonitor volume_monitor_managed = GLib.Object.GetObject(volume_monitor, false) as VolumeMonitor;
         volume_monitor_managed.OnVolumeAdded(GLib.VolumeAdapter.GetObject(volume, false));
     } catch (Exception e) {
         GLib.ExceptionManager.RaiseUnhandledException(e, false);
     }
 }
Ejemplo n.º 3
0
 static void mountremoved_cb(IntPtr volume_monitor, IntPtr mount)
 {
     try {
         VolumeMonitor volume_monitor_managed = GLib.Object.GetObject(volume_monitor, false) as VolumeMonitor;
         volume_monitor_managed.OnMountRemoved(GLib.MountAdapter.GetObject(mount, false));
     } catch (Exception e) {
         GLib.ExceptionManager.RaiseUnhandledException(e, false);
     }
 }
Ejemplo n.º 4
0
		public MountProvider ()
		{
			Monitor = VolumeMonitor.Default;

			foreach (Mount m in Monitor.Mounts) {
				if (IsTrash (m))
					continue;
				Mounts.Add (new MountItem (m));
				Log<MountProvider>.Debug ("Adding {0}.", m.Name);
			}
			
			Monitor.MountAdded += HandleMountAdded;
			Monitor.MountRemoved += HandleMountRemoved;
		
			Items = Mounts.Cast<AbstractDockItem> ();
		}