public override void SetModel(CopyMoveModel m) { base.SetModel(m); this.bindingSource.DataSource = this.model; this.radioButtonCopy.Checked = this.model.Mode == CopyMoveMode.copy; this.radioButtonMove.Checked = this.model.Mode != CopyMoveMode.copy; switch (this.model.DirectoryMode) { case DirectoryMode.ignore: this.cmbDirectoryMode.SelectedIndex = 0; break; case DirectoryMode.createDestinationSubdirs: this.cmbDirectoryMode.SelectedIndex = 1; break; } switch (this.model.ExecuteFollowingMacrosOn) { case ExecuteMacroOn.source: this.comboBoxExecuteMacroOn.SelectedIndex = 0; break; case ExecuteMacroOn.destination: this.comboBoxExecuteMacroOn.SelectedIndex = 1; break; } this.textDirectoryName.Enabled = this.cmbDirectoryMode.SelectedIndex != 0; }
public CopyMoveController(CopyMoveModel m, IStatusDisplay statusDisplay) { this.statusDisplay = statusDisplay; model = m; backgroundWorker = new BackgroundWorker(); backgroundWorker.WorkerReportsProgress = true; backgroundWorker.DoWork += new DoWorkEventHandler(backgroundWorker_DoWork); backgroundWorker.ProgressChanged += new ProgressChangedEventHandler(statusDisplay.WorkProgressChanged); backgroundWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker_RunWorkerCompleted); }