TfsWitAdminTools.ViewModel.ToolsVM.Init C# (CSharp) Method

Init() private method

private Init ( IWitAdminService wiAdminService ) : void
wiAdminService IWitAdminService
return void
        private void Init(IWitAdminService wiAdminService)
        {
            WitAdminService = wiAdminService;

            TargetTemplateName = "Agile";

            #region Commands

            SetAddressCommand = new DelegateCommand(() =>
            {
                TFManager = DiManager.Current.Resolve<ITFManager>(new { serverAddress = Address });
                InitChildViewModelsCommand.Execute(this);
                GetProjectCollectionInfosCommand.Execute(this);
            },
            () => !string.IsNullOrEmpty(Address)
            );

            ResetTFManagerCommand = new DelegateCommand(() =>
            {
                TFManager = null;
                ProjectCollectionInfos = null;
            });

            GetProjectCollectionInfosCommand = new DelegateCommand(async () =>
            {
                ProjectCollectionInfos = await GetProjectCollectionInfos(TFManager);
            },
            () => TFManager != null
            );

            GetAllTeamProjectsWITypesCommand = new DelegateCommand(async () =>
            {
                await GetAllTeamProjectsWITypes();
            }, () => CurrentProjectCollection != null);

            GetWITypesCommand = new DelegateCommand(async () =>
            {
                TeamProjectInfo currentTeamProject = CurrentTeamProject;
                await GetWITypes(currentTeamProject);
            },
            () => (CurrentProjectCollection != null && CurrentTeamProject != null));

            InitChildViewModelsCommand = new DelegateCommand(() =>
            {
                Progress = DiManager.Current.Resolve<ProgressVM>(new { tools = this });

                WIDViewer = DiManager.Current.Resolve<WIDViewerVM>(new { tools = this });
                WIDExport = DiManager.Current.Resolve<WIDExportVM>(new { tools = this });
                WIDImport = DiManager.Current.Resolve<WIDImportVM>(new { tools = this });
                WIDRename = DiManager.Current.Resolve<WIDRenameVM>(new { tools = this });
                WIDDestroy = DiManager.Current.Resolve<WIDDestroyVM>(new { tools = this });

                CategoriesViewer = DiManager.Current.Resolve<CategoriesViewerVM>(new { tools = this });
                CategoriesExport = DiManager.Current.Resolve<CategoriesExportVM>(new { tools = this });
                CategoriesImport = DiManager.Current.Resolve<CategoriesImportVM>(new { tools = this });

                ProcessConfigViewer = DiManager.Current.Resolve<ProcessConfigViewerVM>(new { tools = this });
                ProcessConfigExport = DiManager.Current.Resolve<ProcessConfigExportVM>(new { tools = this });
                ProcessConfigImport = DiManager.Current.Resolve<ProcessConfigImportVM>(new { tools = this });
            },
            () => TFManager != null);

            ClearOutputCommand = new DelegateCommand(() =>
            {
                Output = string.Empty;
            },
            () => !string.IsNullOrEmpty(Output));

            #endregion

            #region Events

            wiAdminService.CommandInvoked += wiAdminService_CommandInvoked;

            #endregion
        }