1
Fork 0

added final validation for copying files

This commit is contained in:
Jake Howard 2014-12-04 23:18:35 +00:00
parent 46d914e2a4
commit 429b507153

View file

@ -23,6 +23,14 @@ namespace Saviour_Backup_System
InitializeComponent(); InitializeComponent();
} }
public void startCopy(DriveInfo drive, string endDirectory, bool visible) { //used for validation to make sure the copy wont fail.
if (!Directory.Exists(drive.Name)) { MessageBox.Show("The drive directory does not exist."); }
else if (!Directory.Exists(endDirectory)) { MessageBox.Show("The end directory does not exist."); }
else { copyFiles(drive.Name.Substring(0, 1), endDirectory, visible); }
}
private void copyFiles(string driveLetter, string endDirectory, bool display) //actually starts the backups (and loads the dialogs) private void copyFiles(string driveLetter, string endDirectory, bool display) //actually starts the backups (and loads the dialogs)
{ {
backups++; //appends to the number of backups running backups++; //appends to the number of backups running