1
Fork 0

Began development on drive details panel

This commit is contained in:
Jake Howard 2014-07-27 20:59:31 +01:00
parent f8f8e3ac9e
commit 6753feb8be

View file

@ -17,7 +17,7 @@ namespace Saviour_Backup_System
scanTimer.Interval = 1000 * 7; //seconds to check for new drives scanTimer.Interval = 1000 * 7; //seconds to check for new drives
scanTimer.Start(); scanTimer.Start();
} }
private static List<string> connectedDrives; private static List<string> connectedDrives = null;
private static void driveScanTick(object sender, ElapsedEventArgs e) private static void driveScanTick(object sender, ElapsedEventArgs e)
{ {
List<string> drivesSnapshot = connectedDrives; List<string> drivesSnapshot = connectedDrives;
@ -46,10 +46,20 @@ namespace Saviour_Backup_System
} }
return drivesList.ToArray(); return drivesList.ToArray();
} }
public void safelyEjectDrive(string driveChar) public void safelyEjectDrive(string driveChar)
{ {
driveChar = driveChar.Remove(driveChar.Length - 1); driveChar = driveChar.Remove(driveChar.Length - 1);
RemoveDriveTools.RemoveDrive(driveChar); RemoveDriveTools.RemoveDrive(driveChar);
} }
public static void displayDriveDetails(string driveName)
{
DriveInfo selectedDrive;
foreach (DriveInfo drive in getConnectedDrives()){ if (drive.Name == driveName){ selectedDrive = drive; break; } }
}
} }
} }