1
Fork 0

Added refresh code for button, and began development for selecting drive

This commit is contained in:
Jake Howard 2014-07-22 21:14:30 +01:00
parent 011a1c3921
commit c893029596

View file

@ -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);
}
}
}