public TFSWorkItemManager()

in Mail2Bug/WorkItemManagement/TFSWorkItemManager.cs [23:60]


        public TFSWorkItemManager(Config.InstanceConfig config)
        {
            ValidateConfig(config);

            _config = config;

            // Init TFS service objects
            _tfsServer = ConnectToTfsCollection();
            Logger.InfoFormat("Connected to TFS. Getting TFS WorkItemStore");

            _tfsStore = _config.TfsServerConfig.BypassRules
                ? new WorkItemStore(_tfsServer, WorkItemStoreFlags.BypassRules)
                : _tfsServer.GetService<WorkItemStore>();

            if (_tfsStore == null)
            {
                Logger.ErrorFormat("Cannot initialize TFS Store");
                throw new Exception("Cannot initialize TFS Store");
            }

            Logger.InfoFormat("Geting TFS Project");
            _tfsProject = _tfsStore.Projects[config.TfsServerConfig.Project];


            Logger.InfoFormat("Getting Team Config");
            var teamConfig = _tfsStore.TeamProjectCollection.GetService<Microsoft.TeamFoundation.ProcessConfiguration.Client.TeamSettingsConfigurationService>()
                .GetTeamConfigurationsForUser(new[] { _tfsProject.Uri.ToString() });

            if (teamConfig != null)
            {
                _teamSettings = teamConfig.First().TeamSettings;
            }

            Logger.InfoFormat("Initializing WorkItems Cache");
            InitWorkItemsCache();

            _nameResolver = InitNameResolver();
        }