public static IAreaManager GetManager(ProjectDetail projectDetail, ITfsCredentials tfsCredentials = null)
        {
            IAreaManager result;
            if (AreaManagers.FirstOrDefault(o => o.Key.CollectionUri == projectDetail.CollectionUri && o.Key.ProjectName == projectDetail.ProjectName).Value != null)
            {
                result = AreaManagers.FirstOrDefault(o => o.Key.CollectionUri == projectDetail.CollectionUri && o.Key.ProjectName == projectDetail.ProjectName).Value;
            }
            else
            {
                result = new AreaManager(projectDetail, tfsCredentials);
                AreaManagers.AddOrUpdate(projectDetail, result, (key, oldValue) => result);
            }

            return result;
        }
Example #2
0
        public AreaManager(ProjectDetail projectDetail, ITfsCredentials tfsCredentials)
        {
            this.projectDetail = projectDetail;

            this.tfsTeamProjectCollection = TfsApi.Administration.TfsTeamProjectCollectionFactory.GetTeamProjectCollection(this.projectDetail.CollectionUri, tfsCredentials);

            this.teamConfig = this.tfsTeamProjectCollection.GetService<TeamSettingsConfigurationService>();

            this.commonStructureService = (ICommonStructureService4)this.tfsTeamProjectCollection.GetService(typeof(ICommonStructureService4));

            this.projectInfo = this.commonStructureService.GetProjectFromName(this.projectDetail.ProjectName);

            foreach (TeamConfiguration item in this.teamConfig.GetTeamConfigurationsForUser(new[] { this.projectInfo.Uri }))
            {
                this.teamConfiguration = item;
                break;
            }
        }
Example #3
0
        public TeamManager(Dto.ProjectDetail projectDetail, TfsApi.Contracts.ITfsCredentials tfsCredentials)
        {
            this.tfsCredentials = tfsCredentials;

            this.projectDetail = projectDetail;

            this.tfsTeamProjectCollection = TfsApi.Administration.TfsTeamProjectCollectionFactory.GetTeamProjectCollection(this.projectDetail.CollectionUri, this.tfsCredentials);

            this.teamSettingsConfigurationService = this.tfsTeamProjectCollection.GetService<TeamSettingsConfigurationService>();

            this.commonStructureService = (ICommonStructureService4)this.tfsTeamProjectCollection.GetService(typeof(ICommonStructureService4));

            this.projectInfo = this.commonStructureService.GetProjectFromName(this.projectDetail.ProjectName);

            this.groupSecurityService = (IGroupSecurityService)this.tfsTeamProjectCollection.GetService<IGroupSecurityService>();

            this.TfsTeamService = (Microsoft.TeamFoundation.Client.TfsTeamService)this.tfsTeamProjectCollection.GetService(typeof(Microsoft.TeamFoundation.Client.TfsTeamService));
        }