-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMediaDrive.cs
35 lines (33 loc) · 1.25 KB
/
MediaDrive.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System.Management;
namespace MAS7.Models
{
/// <summary>
/// Represents a Media Storage Device.
/// </summary>
public class MediaDrive
{
public string Caption { get; }
public string FirmwareRevision { get; }
public string InterfaceType { get; }
public string MediaType { get; }
public string Model { get; }
public string Partitions { get; }
public string SerialNumber { get; }
public string Size { get; }
public string Status { get; }
public string Index { get; }
public MediaDrive(ManagementObject moDrive)
{
Caption = moDrive["Caption"].ToString();
FirmwareRevision = moDrive["FirmwareRevision"].ToString();
InterfaceType = moDrive["InterfaceType"].ToString();
MediaType = moDrive["MediaType"].ToString();
Model = moDrive["Model"].ToString();
Partitions = moDrive["Partitions"].ToString();
SerialNumber = moDrive["SerialNumber"].ToString();
Size = (decimal.Parse(moDrive["Size"].ToString()) / 1073741824).ToString().Substring(0, 8);
Status = moDrive["Status"].ToString();
Index = moDrive["Index"].ToString();
}
}
}