private void startBackup(string drive) { if (!Settings.runBackup) return; if (!Settings.sourceValid || !Settings.destinationValid) return; status_view.setActiveState(); backup = new Backup(); backup.sourcePath = new EPath(String.Format("{0}:\\", drive[0])); backup.destinationPath = new EPath(Settings.destination_path); backup.backupDone += new BackupDoneHandler(report.submit); backup.backupDone += new BackupDoneHandler(status_view.updateStatus); backup.start(); }
private void OnDriveRemoved(object sender, DriveDetectorEventArgs e) { // TODO: do clean up here, etc. Letter of the removed drive is in // the variable e.Drive status_view.setConnectedStatus(false); if (backup == null) return; if (e.Drive[0] != backup.sourcePath.driveLetter) return; backup.stop(); backup = null; }