private void RunResync(object sender, DoWorkEventArgs e) { var worker = sender as BackgroundWorker; var syncronizer = new Core.InteractiveFileChangesSync() { User = Settings.User, Host = Settings.Host, SourcePath = Settings.SourcePath, DestinationPath = Settings.DestinationPath, PrivateKey = Settings.PrivateKey, Excludes = new HashSet <String>(Settings.Excludes.Cast <String>()), }; /// todo make separate item for resync, handle menu items better ChangeIconToProcessingFromThread(); syncronizer.Resync(); e.Cancel = true; }
private void RunSyncronizer(object sender, DoWorkEventArgs e) { var worker = sender as BackgroundWorker; var syncronizer = new Core.InteractiveFileChangesSync() { User = Settings.User, Host = Settings.Host, SourcePath = Settings.SourcePath, DestinationPath = Settings.DestinationPath, PrivateKey = Settings.PrivateKey, Excludes = new HashSet <String>(Settings.Excludes.Cast <String>()), }; syncronizer.OnChangesProcessed += new Action(ChangeIconToProcessingFromThread); syncronizer.OnChangesWait += new Action(ChangeIconToStartedFromThread); syncronizer.OnStop += new Action(ChangeIconToStoppedFromThread); syncronizer.Start(() => worker.CancellationPending); e.Cancel = true; }