private void CreateFeatureBranch() { Validate(); StartBusyAction(() => { var selectedComponents = ExtractSelectedComponents(this.SelectedComponents.Items); var backgroundOperation = new StandardBackgroundOperation(); ServiceLocator.GetInstance <IBackgroundOperationsRegion>().RegisterOperation(backgroundOperation); try { _mainBranch.CreateFeatureBranch(this.FeatureName, selectedComponents, (args) => { backgroundOperation.Update(args.Percentage, args.ActionDescription); }); } catch (Exception ex) { backgroundOperation.Failed($"Failed to create feature '{this.FeatureName}'", ex.ToString()); throw; } ServiceLocator.GetInstance <IBackgroundOperationsRegion>().UnregisterOperation(backgroundOperation); Deactivate(); }); }
private void AddMissingComponents() { var selectedComponents = ExtractSelectedComponents(this.SelectedComponents.Items); StartBusyAction(() => { var backgroundOperation = new StandardBackgroundOperation(); ServiceLocator.GetInstance <IBackgroundOperationsRegion>().RegisterOperation(backgroundOperation); try { FeatureBranch.AddMissingComponents(selectedComponents.ToArray(), (eventData) => { backgroundOperation.Update(eventData.Percentage, eventData.ActionDescription); }); } catch (Exception ex) { backgroundOperation.Failed($"Failed to add missing components to '{this.FeatureBranch.Name}' feature", ex.ToString()); throw; } ServiceLocator.GetInstance <IBackgroundOperationsRegion>().UnregisterOperation(backgroundOperation); this.Deactivate(); }); }
public override void Execute(object parameter) { _backgroundAction = new StandardBackgroundOperation(); _serviceLocator.GetInstance <IBackgroundOperationsRegion>().RegisterOperation(_backgroundAction); _serviceLocator.GetInstance <IApplicationServices>().StartNewParallelTask(CreateBranch); RaiseCanExecuteChanged(); }
public override void Execute(object parameter) { _backgroundAction = new StandardBackgroundOperation(); _serviceLocator.GetInstance <IBackgroundOperationsRegion>().RegisterOperation(_backgroundAction); _serviceLocator.GetInstance <IApplicationServices>().StartNewParallelTask( () => _logicalBranch.CreateDevelopmentBranch(ProgressHandler, ErrorHandler)); RaiseCanExecuteChanged(); }
public override void Execute(object parameter) { _backgroundAction = new StandardBackgroundOperation(); _serviceLocator.GetInstance <IBackgroundOperationsRegion>().RegisterOperation(_backgroundAction); _serviceLocator.GetInstance <IApplicationServices>().StartNewParallelTask( () => { try { _rootBranch.Branch(ProgressHandler); } catch (Exception ex) { ErrorHandler(ex); throw; } }); RaiseCanExecuteChanged(); }