protected virtual void OnFinishCommand(object obj) { _wizard = (Wizard)obj; ProgressCounter progressCounter = new ProgressCounter(Title, "Persisting object...", 1); LongRunningJob <T> projectCreationJob = new LongRunningJob <T>(DoFinish, progressCounter); projectCreationJob.AddAction(delegate { _wizard.Dispatcher.Invoke(DispatcherPriority.Normal, new ThreadStart(CloseWizardOnFinish)); }); projectCreationJob.Execute(Dto); }
protected override void DoExecute(ExecutionEvent executionEvent) { _projectId = executionEvent.GetFirstSelectedTreeNavigationItem().ProjectId; try { ProgressCounter progressCounter = new ProgressCounter("Generate", "Generating the CSV files...", 1); LongRunningJob <GenerateDto> projectCreationJob = new LongRunningJob <GenerateDto>(GenerateAction, progressCounter); projectCreationJob.AddAction(delegate { _generateWindow.Dispatcher.Invoke(AfterGenerateAction, DispatcherPriority.Normal); }); projectCreationJob.Execute(_generateDto); } catch (Exception ex) { OnFailure(executionEvent); } }