/[DiskWriteCacheDisabler]/trunk/libDiskpart/Diskpart/Interop.cs
ViewVC logotype

Diff of /trunk/libDiskpart/Diskpart/Interop.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/libDiskpart/Diskpart/Interop.cs	2012/08/03 07:21:09	50
+++ trunk/libDiskpart/Diskpart/Interop.cs	2012/08/09 07:44:20	51
@@ -1,4 +1,11 @@
 #define LIBDISKPART_ENABLE_UNITTESTING // when defined will log diskpart ouput
+#region t
+#define LIBDISKPART_ENABLE_VOLUME_ENUMERATION // when defined will enable method ListVolumes()
+//#define LIBDISKPART_ENABLE_DISK_ENUMERATION // when defined will enable method ListDisks()
+//#define LIBDISKPART_ENABLE_VIRTUALDISK_ENUMERATION // when defined will enable method ListVirtualDisks()
+//#define LIBDISKPART_ENABLE_PARTITION_ENUMERATION // when defined will enable method ListPartitions()
+#endregion
+
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -100,29 +107,49 @@
 
 
         #region Diskpart List Support
-        public static void ListVolumes()
+        public static void EnumerateVolumes()
         {
+#if !LIBDISKPART_ENABLE_VOLUME_ENUMERATION
+            Console.WriteLine("WARNING: Volume enumeration has not been enabled!");
+            return;
+#else
             List<string> output = CreateDiskpartProcess("list vol");
             List<IVolumeInformation> collection = new List<IVolumeInformation>();
             VolumeInformation.Parse(output, out collection);
             LogOutput(output);
+#endif
         }
-        public static void ListDisks()
+        public static void EnumerateDisks()
         {
+#if !LIBDISKPART_ENABLE_DISK_ENUMERATION
+            Console.WriteLine("WARNING: Disk enumeration has not been enabled!");
+            return;
+#else
             List<string> output = CreateDiskpartProcess("list disk");
             LogOutput(output);
+#endif
         }
-        public static void ListVirtualDisks()
+        public static void EnumerateVirtualDisks()
         {
+#if !LIBDISKPART_ENABLE_VIRTUALDISK_ENUMERATION
+            Console.WriteLine("WARNING: Virtual Disk enumeration has not been enabled!");
+            return;
+#else
             List<string> output = CreateDiskpartProcess("list vdisk");
             LogOutput(output);
+#endif
         }
-        public static void ListPartitions(int volume_number)
+        public static void EnumeratePartitions(int volume_number)
         {
+#if !LIBDISKPART_ENABLE_PARTITION_ENUMERATION
+            Console.WriteLine("WARNING: Partition enumeration has not been enabled!");
+            return;
+#else
             List<string> output = CreateDiskpartProcess(string.Format("sel vol {0}", volume_number), "list part");
             LogOutput(output);
+#endif
         }
-       
+
         #endregion
 
     }

 

  ViewVC Help
Powered by ViewVC 1.1.22