mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-12-24 03:15:26 +00:00
new sample for VolumeMonitor, Volume, ...
svn path=/trunk/gtk-sharp/; revision=126610
This commit is contained in:
parent
54d4f811b2
commit
a62a57d877
|
@ -1,4 +1,4 @@
|
|||
TARGETS = AppInfo.exe
|
||||
TARGETS = AppInfo.exe Volume.exe
|
||||
|
||||
DEBUGS = $(addsuffix .mdb, $(TARGETS))
|
||||
|
||||
|
@ -12,8 +12,9 @@ noinst_SCRIPTS = $(TARGETS)
|
|||
CLEANFILES = $(TARGETS) $(DEBUGS)
|
||||
|
||||
.cs.exe: $(assemblies)
|
||||
$(CSC) /out:$@ $(references) $<
|
||||
$(CSC) /debug /out:$@ $(references) $<
|
||||
|
||||
EXTRA_DIST = \
|
||||
AppInfo.cs
|
||||
AppInfo.cs \
|
||||
Volume.cs
|
||||
|
||||
|
|
31
sample/gio/Volume.cs
Normal file
31
sample/gio/Volume.cs
Normal file
|
@ -0,0 +1,31 @@
|
|||
using GLib;
|
||||
using System;
|
||||
|
||||
namespace TestGio
|
||||
{
|
||||
public class TestVolume
|
||||
{
|
||||
static void Main (string[] args)
|
||||
{
|
||||
GLib.GType.Init ();
|
||||
VolumeMonitor monitor = VolumeMonitor.Default;
|
||||
Console.WriteLine ("Volumes:");
|
||||
foreach (Volume v in monitor.Volumes)
|
||||
Console.WriteLine ("\t{0}", v);
|
||||
Console.WriteLine ("\nMounts:");
|
||||
foreach (Mount m in monitor.Mounts) {
|
||||
Console.WriteLine ("\tName:{0}, UUID:{1}, root:{2}, CanUnmount: {3}", m.Name, m.Uuid, m.Root, m.CanUnmount);
|
||||
Volume v = m.Volume;
|
||||
if (v != null)
|
||||
Console.WriteLine ("\t\tVolume:{0}", v.Name);
|
||||
Drive d = m.Drive;
|
||||
if (d != null)
|
||||
Console.WriteLine ("\t\tDrive:{0}", d.Name);
|
||||
}
|
||||
Console.WriteLine ("\nConnectedDrives:");
|
||||
foreach (object o in monitor.ConnectedDrives)
|
||||
Console.WriteLine ("\t{0}", o);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in a new issue