コード例 #1
0
ファイル: AreaManager.cs プロジェクト: devoneonline/Tfs-Api
        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;
            }
        }
コード例 #2
0
ファイル: TeamManager.cs プロジェクト: devoneonline/Tfs-Api
        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));
        }
 private static ProjectInfo[] CreateProjectInfos(int quantity, int buildDefinitionQuantity, int buildDetailQuantity, IBuildServer mockBuildServer)
 {
     var projectInfos = new ProjectInfo[quantity];
     for (var i = 0; i < quantity; i++)
     {
         var projectInfo = new ProjectInfo {Name = string.Format("TeamProject{0}", i)};
         projectInfos[i] = projectInfo;
         mockBuildServer.Stub(m => m.QueryBuildDefinitions(projectInfo.Name))
             .Return(CreateFakeBuildDefinitions(projectInfo.Name, buildDefinitionQuantity, buildDetailQuantity, mockBuildServer));
     }
     return projectInfos;
 }
コード例 #4
0
 internal ProjectInfo(Tfs.ProjectInfo projectInfo)
 {
     _projectInfo = projectInfo ?? throw new ArgumentNullException(nameof(projectInfo));
 }
コード例 #5
0
 public void OpenBuildSecurityDialog(string projectName, string projectUri)
 {
     var projectInfo = new ProjectInfo(projectUri, projectName, ProjectState.WellFormed);
     var artifactId = LinkingUtilities.DecodeUri(projectUri);
     _teamFoundationBuild.Value.BuildExplorerWrapper.OpenBuildSecurityDialog(projectInfo, projectInfo.Name, artifactId.ToolSpecificId);
 }
コード例 #6
0
        public void OpenBuildDefinitionSecurityDialog(string projectName, string projectUri, string definitionName, string definitionUri)
        {
            var projectInfo = new ProjectInfo(projectUri, projectName, ProjectState.WellFormed);

            var projectArtifactId = LinkingUtilities.DecodeUri(projectUri);
            var definitionArtifactId = LinkingUtilities.DecodeUri(definitionUri);

            var securityToken = string.Concat(projectArtifactId.ToolSpecificId, BuildSecurity.NamespaceSeparator, definitionArtifactId.ToolSpecificId);

            _teamFoundationBuild.Value.BuildExplorerWrapper.OpenBuildSecurityDialog(projectInfo, definitionName, securityToken);
        }
コード例 #7
0
 public MyTfsProject(ProjectInfo projectInfo, IBuildServer buildServer, MyTfsProjectCollection projectCollection)
 {
     _projectInfo = projectInfo;
     _buildServer = buildServer;
     _projectCollection = projectCollection;
 }
コード例 #8
0
ファイル: App.xaml.cs プロジェクト: nagyist/BuildManager
 public AppTfsContext(TfsTeamProjectCollection collection, ProjectInfo selectedProject)
 {
     this.collection = collection;
     this.selectedProject = selectedProject;
 }
コード例 #9
0
        private void BuildQueryHierarchy(ProjectInfo project, QueryHierarchy queryHierarchy)
        {
            tvwQueries.Nodes.Clear();

            var root = new TreeNode(project.Name);
            foreach (QueryFolder query in queryHierarchy)
            {
                DefineFolder(query, root);
            }

            tvwQueries.Nodes.Add(root);
        }
コード例 #10
0
 public void OpenBuildSecurityDialog(ProjectInfo projectInfo, string name, string securityToken)
 {
     _openBuildSecurityDialogMethod.Value.Invoke(null, new object[] {projectInfo, name, securityToken});
 }
コード例 #11
0
 internal ProjectInfoProxy(Tfs.ProjectInfo projectInfo)
 {
     _projectInfo = projectInfo;
 }
コード例 #12
0
ファイル: TfsShared.cs プロジェクト: benjamin33/MTMCopyTool
        private async Task Connect(string tfsUrl, string projectName, bool source, bool bypassRules)
        {
            await Task.Factory.StartNew(() =>
            {
                if (source)
                {
                    SourceTFS = new TfsTeamProjectCollection(new Uri(tfsUrl));
                    var service = (ITestManagementService)SourceTFS.GetService(typeof(ITestManagementService));
                    SourceTestProject = (ITestManagementTeamProject)service.GetTeamProject(projectName);
                    SourceProject = new ProjectInfo()
                    {
                        Name = SourceTestProject.WitProject.Name,
                        Uri = SourceTestProject.WitProject.Uri.AbsoluteUri
                    };
                }
                else
                {
                    TargetTFS = new TfsTeamProjectCollection(new Uri(tfsUrl));
                    var service = (ITestManagementService)TargetTFS.GetService(typeof(ITestManagementService));
                    TargetTestProject = (ITestManagementTeamProject)service.GetTeamProject(projectName);
                    TargetProject = new ProjectInfo()
                    {
                        Name = TargetTestProject.WitProject.Name,
                        Uri = TargetTestProject.WitProject.Uri.AbsoluteUri
                    };

                    WorkItemStore store = new WorkItemStore(TargetTFS, bypassRules ? WorkItemStoreFlags.BypassRules : WorkItemStoreFlags.None);

                    TargetProjectWorkItemType = store.Projects[projectName].WorkItemTypes["Test Case"];
                }
            });
        }
コード例 #13
0
		private List<Type> GetWorkItemTypes(ProjectInfo projectInfo)
		{
			string.Format("Getting TFS Work Item Types for project {0}", projectInfo.Name).Debug();
			var workItemTypes = new List<Type>();

			if (_projectCollectionWorkItemStore == null) return workItemTypes;

			var proj = _projectCollectionWorkItemStore.Projects[projectInfo.Name];

			if (proj == null || proj.WorkItemTypes == null) return workItemTypes;

			foreach (Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemType workItemType in proj.WorkItemTypes)
			{
				workItemTypes.Add(new Type(workItemType.Name, GetStates(workItemType)));
			}
			return workItemTypes;
		}
コード例 #14
0
        private ProcessTemplateProperties GetProcessTemplateProperties(ProjectInfo pi)
        {
            ProcessTemplateProperties ptp = new ProcessTemplateProperties();
            // Read the properties
            string projectName = string.Empty;
            string projectState = string.Empty;
            int templateId = 0;
            ProjectProperty[] projectProperties = null;

            css.GetProjectProperties(pi.Uri, out projectName, out projectState, out templateId, out projectProperties);

            // Return the properties
            string currentVersion = projectProperties.Where(p => (p.Name == ProcessTemplateProperties.CURRENTVERSIONSTRING)).Select(p => p.Value).FirstOrDefault();
            string createVersion = projectProperties.Where(p => (p.Name == ProcessTemplateProperties.CREATEVERSIONSTRING)).Select(p => p.Value).FirstOrDefault();
            string pt = projectProperties.Where(p => (p.Name == ProcessTemplateProperties.PROCESSTEMPLATESTRING)).Select(p => p.Value).FirstOrDefault();

            ptp.CurrentVersion = currentVersion;
            ptp.CreateVersion = createVersion;
            ptp.ProcessTemplate = pt;
            ptp.CurrentProject = pi;

            return ptp;
        }