Beispiel #1
0
        /// <summary>
        /// Converts <see cref="PARTITION_STYLE"/> enumerator to string.
        /// </summary>
        /// <param name="partitionStyle">The partition style as <see cref="PARTITION_STYLE"/></param>
        /// <returns>String representation of current enumerator</returns>
        internal static string ConvertToString(this PARTITION_STYLE partitionStyle)
        {
            string style = string.Empty;

            switch (partitionStyle)
            {
            case PARTITION_STYLE.PARTITION_STYLE_GPT:
                style = "GPT";
                break;

            case PARTITION_STYLE.PARTITION_STYLE_MBR:
                style = "MBR";
                break;

            case PARTITION_STYLE.PARTITION_STYLE_RAW:
                style = "RAW";
                break;

            default:
                style = "Unknown 'PARTITION_STYLE'. Raw value: " + ((uint)partitionStyle).ToString(System.Globalization.CultureInfo.InvariantCulture);
                break;
            }

            return(style);
        }
Beispiel #2
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="volume">The volume identifier of the physical drive.</param>
 /// <param name="size">The disk size, in bytes.</param>
 /// <param name="geometry">The disk geometry of the physical drive.</param>
 /// <param name="partitionStyle">The style of the partitions on the drive.</param>
 public DriveInfo(uint driveNumber, Int64 size, DISK_GEOMETRY geometry, PARTITION_STYLE partitionStyle)
 {
     DriveNumber    = driveNumber;
     Size           = size;
     Geometry       = geometry;
     PartitionStyle = partitionStyle;
     Partitions     = new List <PARTITION_INFORMATION_EX>();
 }
Beispiel #3
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="volume">The volume identifier of the physical drive.</param>
 /// <param name="size">The disk size, in bytes.</param>
 /// <param name="geometry">The disk geometry of the physical drive.</param>
 /// <param name="partitionStyle">The style of the partitions on the drive.</param>
 public DriveInfo(uint driveNumber, Int64 size, DISK_GEOMETRY geometry, PARTITION_STYLE partitionStyle)
 {
     DriveNumber = driveNumber;
     Size = size;
     Geometry = geometry;
     PartitionStyle = partitionStyle;
     Partitions = new List<PARTITION_INFORMATION_EX>();
 }