Added refresh code for button, and began development for selecting drive
This commit is contained in:
parent
011a1c3921
commit
c893029596
1 changed files with 26 additions and 4 deletions
|
@ -16,10 +16,32 @@ namespace Saviour_Backup_System
|
|||
public mainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
ListViewItem item1 = new ListViewItem("Something");
|
||||
item1.SubItems.Add("SubItem1a");
|
||||
item1.SubItems.Add("SubItem1b");
|
||||
listViewEx1.Items.AddRange(new ListViewItem[] { item1});
|
||||
}
|
||||
refreshDriveList();
|
||||
}
|
||||
public void refreshDriveList()
|
||||
{
|
||||
DriveInfo[] drives = USBTools.getConnectedDrives();
|
||||
connectedDrivesList.Items.Clear();
|
||||
foreach (DriveInfo drive in drives){
|
||||
ListViewItem driveItem = new ListViewItem(drive.Name + " " + drive.VolumeLabel);
|
||||
driveItem.SubItems.Add("X");
|
||||
connectedDrivesList.Items.Add(driveItem);
|
||||
}
|
||||
connectedDrivesList.Sort();
|
||||
}
|
||||
|
||||
private void connectedDrivesListRefresh_Click(object sender, EventArgs e)
|
||||
{
|
||||
refreshDriveList();
|
||||
}
|
||||
|
||||
private void connectedDrivesList_Click(object sender, EventArgs e)
|
||||
{
|
||||
string currentItem = connectedDrivesList.SelectedItems.ToString();
|
||||
|
||||
int index = connectedDrivesList.FindString(currentItem);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue