private void OnEraseComplete(object sender, RunWorkerCompletedEventArgs e) { BackgroundOperations.MusicEraseResult result = (BackgroundOperations.MusicEraseResult)e.Result; BackgroundOperations.LogResult(result.Result, result.ErrorMessage); switch (result.Result) { case BackgroundOperations.OperationResult.Canceled: case BackgroundOperations.OperationResult.Failed: return; case BackgroundOperations.OperationResult.SucceededWithWarnings: case BackgroundOperations.OperationResult.SucceededWithErrors: if (Utils.ShowQuestion(null, msgContinueAfterProblems, MessageBoxButtons.YesNo) == DialogResult.No) { return; } break; } // Start to convert. Logger.WriteLine("Convert new and changed files..."); // Create a worker and show the conversion progress. BackgroundWorker worker = BackgroundOperations.CreateMusicConverter(); worker.RunWorkerCompleted += OnConvertComplete; worker.RunWorkerAsync(new BackgroundOperations.MusicConvertArguments(comparer)); }
private void OnCompareComplete(object sender, RunWorkerCompletedEventArgs e) { BackgroundOperations.CompareResult result = (BackgroundOperations.CompareResult)e.Result; BackgroundOperations.LogResult(result.Result, result.ErrorMessage); comparer = result.Comparer; if (OnCompared != null) { OnCompared(this, EventArgs.Empty); } }