コード例 #1
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();
            });
        }
コード例 #2
0
 private void LoadComponents()
 {
     this.Components = new ComponentsExplorerBar(FeatureBranch.GetComponents(),
                                                 ServiceLocator);
 }