コード例 #1
0
 public AddMultipleProjectsProgressViewModel(
     [NotNull] IWindowService windowService,
     [NotNull] INVsSolution solution,
     AddMultipleProjectsConfigurationViewModel configurationViewModel,
     [NotNull] SolutionItemHierarchy solutionItemHierarchy)
 {
     if (solutionItemHierarchy == null)
     {
         throw new ArgumentNullException(nameof(solutionItemHierarchy));
     }
     _WindowService          = windowService ?? throw new ArgumentNullException(nameof(windowService));
     _Solution               = solution ?? throw new ArgumentNullException(nameof(solution));
     _ConfigurationViewModel = configurationViewModel;
     SolutionItemHierarchy   =
         solutionItemHierarchy.SolutionItems;
     SolutionItemCount            = solutionItemHierarchy.NumberOfItemsToCreate;
     _HasProjectAddCompleted      = new ObservableProperty <bool>(this);
     _WasProjectAddStarted        = new ObservableProperty <bool>(this);
     _AreThereAnyProjectsSelected =
         new ObservableProperty <bool>(this, solutionItemHierarchy.SolutionItems.Any());
     _NumberOfCreatedProjects        = new ObservableProperty <int>(this);
     _NumberOfCreatedSolutionFolders = new ObservableProperty <int>(this);
     _NumberOfCreatedSolutionItems   = new ObservableProperty <int>(this);
     _NumberOfErrors = new ObservableProperty <int>(this);
     StartCommand    = new DelegateCommand(Start, arg => AreThereAnyProjectsSelected);
     CancelCommand   = new DelegateCommand(Cancel);
     CloseCommand    = new DelegateCommand(Close, arg => HasProjectAddCompleted);
     GoBackToConfigurationCommand = new DelegateCommand(GoBackToConfiguration);
 }
        public SolutionItemHierarchy BuildSolutionItemHierarchy(IEnumerable <IFsItemViewModel> items)
        {
            foreach (var item in items)
            {
                item.Accept(this);
            }

            var hierarchy = new SolutionItemHierarchy();

            hierarchy.NumberOfItemsToCreate = _ItemsCount;
            hierarchy.SolutionItems         = _CurrentContextItems;
            return(hierarchy);
        }