示例#1
0
        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();
            });
        }
示例#2
0
        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();
            });
        }
示例#3
0
 public override void Execute(object parameter)
 {
     _backgroundAction = new StandardBackgroundOperation();
     _serviceLocator.GetInstance <IBackgroundOperationsRegion>().RegisterOperation(_backgroundAction);
     _serviceLocator.GetInstance <IApplicationServices>().StartNewParallelTask(CreateBranch);
     RaiseCanExecuteChanged();
 }
示例#4
0
 public override void Execute(object parameter)
 {
     _backgroundAction = new StandardBackgroundOperation();
     _serviceLocator.GetInstance <IBackgroundOperationsRegion>().RegisterOperation(_backgroundAction);
     _serviceLocator.GetInstance <IApplicationServices>().StartNewParallelTask(
         () => _logicalBranch.CreateDevelopmentBranch(ProgressHandler, ErrorHandler));
     RaiseCanExecuteChanged();
 }
示例#5
0
 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();
 }