2009-02-11 15:07:42 +00:00
|
|
|
using GLib;
|
|
|
|
using System;
|
|
|
|
|
|
|
|
namespace TestGio
|
|
|
|
{
|
|
|
|
public class TestVolume
|
|
|
|
{
|
|
|
|
static void Main (string[] args)
|
|
|
|
{
|
|
|
|
GLib.GType.Init ();
|
|
|
|
VolumeMonitor monitor = VolumeMonitor.Default;
|
|
|
|
Console.WriteLine ("Volumes:");
|
2013-04-01 22:55:17 +00:00
|
|
|
foreach (IVolume v in monitor.Volumes)
|
2009-02-11 15:07:56 +00:00
|
|
|
Console.WriteLine ("\t{0}", v.Name);
|
2009-02-11 15:07:42 +00:00
|
|
|
Console.WriteLine ("\nMounts:");
|
2013-04-01 22:55:17 +00:00
|
|
|
foreach (IMount m in monitor.Mounts) {
|
2009-02-11 15:07:42 +00:00
|
|
|
Console.WriteLine ("\tName:{0}, UUID:{1}, root:{2}, CanUnmount: {3}", m.Name, m.Uuid, m.Root, m.CanUnmount);
|
2013-04-01 22:55:17 +00:00
|
|
|
IVolume v = m.Volume;
|
2009-02-11 15:07:42 +00:00
|
|
|
if (v != null)
|
|
|
|
Console.WriteLine ("\t\tVolume:{0}", v.Name);
|
2013-04-01 22:55:17 +00:00
|
|
|
IDrive d = m.Drive;
|
2009-02-11 15:07:42 +00:00
|
|
|
if (d != null)
|
|
|
|
Console.WriteLine ("\t\tDrive:{0}", d.Name);
|
|
|
|
}
|
|
|
|
Console.WriteLine ("\nConnectedDrives:");
|
2013-04-01 22:55:17 +00:00
|
|
|
foreach (IDrive d in monitor.ConnectedDrives)
|
2009-02-11 15:07:56 +00:00
|
|
|
Console.WriteLine ("\t{0}, HasVolumes:{1}", d.Name, d.HasVolumes);
|
2009-02-11 15:07:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|