예제 #1
0
        /// <summary>
        /// Load settings from server if project context has changed. This refreshes the user
        /// interface in case the tool window is open when connecting / disconnecting
        /// </summary>
        public void LoadSettings()
        {
            _settings = DependencyManagerSettings.Instance;

            // The load is triggered anyways but the load is registered to the same event and not
            // guaranteed to be executed before the ui refresh, so we load it manually before refreshing.
            LoadSettingsFailed = !_settings.Load(_teamFoundationServer.ActiveProjectContext.DomainUri) && IsConnected;

            FetchDependenciesOnLocalSolutionBuild = _settings.FetchDependenciesOnLocalSolutionBuild;
            FilenameExtension           = string.Join(",", _settings.ValidDependencyDefinitionFileExtension);
            RelativeOutputPath          = _settings.RelativeOutputPath;
            BinaryRepositoryTeamProject = _settings.BinaryRepositoryTeamProject;
            IsBinaryRepositoryComponentSettingsEnabled = _settings.IsBinaryRepositoryComponentSettingsEnabled;
            BinaryRepositoryFilterComponentList        = _settings.BinaryRepositoryFilterComponentList;
            BinaryRepositoryTeamProjectCollectionUri   = _settings.BinaryRepositoryTeamProjectCollectionUrl;
            IsZippedDependencyAllowed = _settings.IsZippedDependencyAllowed;
            IsMultiSiteAllowed        = _settings.IsMultiSiteAllowed;
            Sites = string.Join(";", _settings.MultiSiteList);

            // check or uncheck resolver depending on whether their internal name is in the list of disabled resolvers
            foreach (var resolverTypeViewModel in ResolverTypes)
            {
                resolverTypeViewModel.IsEnabled = _settings.DisabledResolvers.Contains(resolverTypeViewModel.ReferenceName) == false;
            }

            RaiseNotifyPropertyChanged(() => IsConnected);
            RaiseNotifyPropertyChanged(() => IsZippedDependencyAllowedAndConnected);
            RaiseNotifyPropertyChanged(() => IsMultiSiteAllowed);
            RaiseNotifyPropertyChanged(() => ProjectContext);
            RaiseNotifyPropertyChanged(() => LoadSettingsFailed);
        }
        /// <summary>
        /// Load settings from server if project context has changed. This refreshes the user
        /// interface in case the tool window is open when connecting / disconnecting
        /// </summary>
        public void LoadSettings()
        {
            _settings = DependencyManagerSettings.Instance;

            // The load is triggered anyways but the load is registered to the same event and not
            // guaranteed to be executed before the ui refresh, so we load it manually before refreshing.
            LoadSettingsFailed = !_settings.Load(_teamFoundationServer.ActiveProjectContext.DomainUri) && IsConnected;

            BinaryRepositoryTeamProject = _settings.BinaryRepositoryTeamProject;
            BinaryRepositoryTeamProjectCollectionUri = _settings.BinaryRepositoryTeamProjectCollectionUrl;
            Sites = string.Join(";", _settings.MultiSiteList);

            LoadMultiSiteComboBox();

            //Load the settings from the local registry
            PathToSevenZipExe = ApplicationSettings.Instance.InstallPathForSevenZip;

            RaiseNotifyPropertyChanged(() => IsConnected);
            RaiseNotifyPropertyChanged(() => ProjectContext);
            RaiseNotifyPropertyChanged(() => LoadSettingsFailed);
        }