Exemplo n.º 1
0
        private void BranchComponents()
        {
            Folders.ComponentsFolder targetComponentsFolder = _targetBranchFolder.Components.Create();

            for (int i = 0; i < _sourceComponents.Count; i++)
            {
                var component = _sourceComponents[i];
                try
                {
                    _progressCallback?.Invoke(ProgressCallbackData.Create(i,
                                                                          _sourceComponents.Count,
                                                                          "Branching " + component.Name));

                    component.As <ISupportBranching>().Do(c => c.Branch(targetComponentsFolder));

                    _progressCallback?.Invoke(ProgressCallbackData.Create(i + 1,
                                                                          _sourceComponents.Count,
                                                                          "Branching " + component.Name));
                }
                catch (Exception ex)
                {
                    throw new ApplicationException($"Failed to branch component {component.Name}!{Environment.NewLine}Error details: {ex.Message}", ex);
                }
            }
        }
Exemplo n.º 2
0
 private void ProgressHandler(ProgressCallbackData eventData)
 {
     _serviceLocator.GetInstance <IApplicationServices>().ExecuteOnUIThread(
         () =>
     {
         RaiseCanExecuteChanged();
         _backgroundAction.Update(eventData.Percentage, eventData.ActionDescription);
         if (_backgroundAction.Status == BackgroundOperationStatus.Done)
         {
             _serviceLocator.GetInstance <IBackgroundOperationsRegion>().UnregisterOperation(_backgroundAction);
         }
     }
         );
 }
Exemplo n.º 3
0
        public void AddMissingComponents(ILogicalComponent[] components, Action <ProgressCallbackData> progressCallBack)
        {
            for (int i = 0; i < components.Length; i++)
            {
                var component = components[i];

                progressCallBack?.Invoke(ProgressCallbackData.Create(i,
                                                                     components.Length,
                                                                     "Branching " + component.Name));

                component.As <ISupportBranching>().Do(c =>
                {
                    c.Branch(_featureFolder.Components);
                });

                progressCallBack?.Invoke(ProgressCallbackData.Create(i + 1,
                                                                     components.Length,
                                                                     "Branching " + component.Name));
            }

            _serviceLocator.GetInstance <IPubSubMediator>().Publish(new FeatureBranchUpdateEventData(this));
        }