Repository navigation
Expand file tree
/
Copy pathfrmDriveInfo.cs
More file actions
70 lines (58 loc) · 2.53 KB
/
Copy pathfrmDriveInfo.cs
File metadata and controls
70 lines (58 loc) · 2.53 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
using System;
using System.Windows.Forms;
using GeneralToolkitLib.Converters;
using FileSystemImage.DataModels;
namespace FileSystemImage
{
public partial class frmDriveInfo : Form
{
private FileSystemDrive currentFileSystemDrive;
public frmDriveInfo()
{
this.InitializeComponent();
}
//TODO replace manually adding data with a binding source from the class FileSystemDriveInfo
private void frmDriveInfo_Load(object sender, EventArgs e)
{
if(this.currentFileSystemDrive != null)
{
string[] items = new string[2];
items[0] = "DriveLetter";
items[1] = this.currentFileSystemDrive.DriveLetter;
this.driveInfoListView.Items.Add(new ListViewItem(items));
items = new string[2];
items[0] = "VolumeLabel";
items[1] = this.currentFileSystemDrive.VolumeLabel;
this.driveInfoListView.Items.Add(new ListViewItem(items));
items = new string[2];
items[0] = "DriveType";
items[1] = this.currentFileSystemDrive.DriveType.ToString();
this.driveInfoListView.Items.Add(new ListViewItem(items));
items = new string[2];
items[0] = "FreeSpace";
items[1] = GeneralConverters.FormatFileSizeToString(this.currentFileSystemDrive.FreeSpace);
this.driveInfoListView.Items.Add(new ListViewItem(items));
items = new string[2];
items[0] = "TotalSpace";
items[1] = GeneralConverters.FormatFileSizeToString(this.currentFileSystemDrive.TotalSpace);
this.driveInfoListView.Items.Add(new ListViewItem(items));
items = new string[2];
items[0] = "Root directory count";
items[1] = this.currentFileSystemDrive.DirectoryList.Count.ToString();
this.driveInfoListView.Items.Add(new ListViewItem(items));
items = new string[2];
items[0] = "Root file count";
items[1] = this.currentFileSystemDrive.RootFileList.Count.ToString();
this.driveInfoListView.Items.Add(new ListViewItem(items));
}
}
private void btnOk_Click(object sender, EventArgs e)
{
Close();
}
public void SetFileSystemDrive(FileSystemDrive fileSystemDrive)
{
this.currentFileSystemDrive = fileSystemDrive;
}
}
}