private void PreviewChanges() { if (this.Configuration != null) { SinkPostProcessStorage postProcess = new SinkPostProcessStorage(this.Provider.Sink, this.Configuration); if (!postProcess.ItemsToProcess) { MessageBox.Show("There are no items to process at this time.", "Preview Changes", MessageBoxButton.OK); } else { String status = postProcess.CollectSummary(); MessageBox.Show(status, "Process Changes Queued", MessageBoxButton.OK); } } }
private async void ProcessChanges() { if (this.Configuration != null) { SinkPostProcessStorage postProcess = new SinkPostProcessStorage(this.Provider.Sink, this.Configuration); if (!postProcess.ItemsToProcess) { MessageBox.Show("There are no items to process at this time.", "Processing", MessageBoxButton.OK); } else { StringBuilder message = new StringBuilder(); message.AppendFormat("This action will move images to new locations on your disk. Use the Process Changes button to view the actions that will be taken {0}{0}", Environment.NewLine); message.AppendFormat("If all moves are succesfully completed, the history of your changes will be cleared. {0}{0}", Environment.NewLine); message.AppendFormat("Would you like to continue with this processing step?"); if (MessageBox.Show(message.ToString(), "Process Changes", MessageBoxButton.YesNo) == MessageBoxResult.Yes) { // Process the changes if (await postProcess.Process()) { MessageBox.Show("Processing complete, provider will be reset", "Processing Complete", MessageBoxButton.OK); // FOrce updates to clear sink and reset UI this.OnConfigurationSaved?.Invoke(this.Provider); this.OnSourceDataUpdated?.Invoke(this.Provider); } else { StringBuilder errorstatus = new StringBuilder(); foreach (String err in postProcess.Status) { errorstatus.AppendFormat(String.Format("{0}{1}", err, Environment.NewLine)); } MessageBox.Show(errorstatus.ToString(), "Processing Errors Occured", MessageBoxButton.OK, MessageBoxImage.Error); } } } } }