diff options
author | sr55 <[email protected]> | 2015-03-01 18:10:34 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2015-03-01 18:10:34 +0000 |
commit | c8e25b9e67daf7c6902428a442ac19bf4306d5c3 (patch) | |
tree | cfaf3560a29050b09fd8934ec6d3ca81abf14984 /win/CS/HandBrakeWPF/Utilities/DriveUtilities.cs | |
parent | 29c62be71227ae33e382199f323890ae3bfffa69 (diff) |
WinGui: Dropping more legacy code and moving some more UI only code up to the UI level.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6960 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/Utilities/DriveUtilities.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/Utilities/DriveUtilities.cs | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/Utilities/DriveUtilities.cs b/win/CS/HandBrakeWPF/Utilities/DriveUtilities.cs new file mode 100644 index 000000000..d07056ef8 --- /dev/null +++ b/win/CS/HandBrakeWPF/Utilities/DriveUtilities.cs @@ -0,0 +1,53 @@ +// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="DriveUtilities.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// The drive utilities.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Utilities
+{
+ using System.Collections.Generic;
+ using System.IO;
+
+ using HandBrakeWPF.Model;
+
+ /// <summary>
+ /// The drive utilities.
+ /// </summary>
+ public class DriveUtilities
+ {
+ /// <summary>
+ /// Get a list of available DVD drives which are ready and contain DVD content.
+ /// </summary>
+ /// <returns>A List of Drives with their details</returns>
+ public static List<DriveInformation> GetDrives()
+ {
+ var drives = new List<DriveInformation>();
+ DriveInfo[] theCollectionOfDrives = DriveInfo.GetDrives();
+ int id = 0;
+ foreach (DriveInfo curDrive in theCollectionOfDrives)
+ {
+ if (curDrive.DriveType == DriveType.CDRom && curDrive.IsReady)
+ {
+ if (Directory.Exists(curDrive.RootDirectory + "VIDEO_TS") ||
+ Directory.Exists(curDrive.RootDirectory + "BDMV"))
+ {
+ drives.Add(
+ new DriveInformation
+ {
+ Id = id,
+ VolumeLabel = curDrive.VolumeLabel,
+ RootDirectory = curDrive.RootDirectory.ToString()
+ });
+ id++;
+ }
+ }
+ }
+
+ return drives;
+ }
+ }
+}
|