Esempio n. 1
0
        /// <summary>
        /// Feed project properties
        /// </summary>
        /// <remarks>keep in the source code for futur use</remarks>
        /// <param name="tpc"></param>
        /// <param name="teamProjectNodes"></param>
        private static void FeedProjectPropertiesData(TfsTeamProjectCollection tpc, string projectUri)
        {
            ICommonStructureService css = tpc.GetService <ICommonStructureService3>();
            string projectName2;
            int    templateId;
            string state;

            ProjectProperty[] properties;
            css.GetProjectProperties(projectUri, out projectName2, out state, out templateId, out properties);
            ProjectInfo projectInfo = css.GetProject(projectUri);

            NodeInfo[] nodeInfo = css.ListStructures(projectUri);
        }
        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);
        }
        public void GetProjectProperties()
        {
            // need TFS_ envvars for this test
            if (String.IsNullOrEmpty(tfsUrl))
            {
                return;
            }
            TeamFoundationServer tfs = new TeamFoundationServer(tfsUrl, credentials);

            ICommonStructureService css = (ICommonStructureService)tfs.GetService(typeof(ICommonStructureService));
            ProjectInfo             p1  = css.GetProjectFromName(Environment.GetEnvironmentVariable("TFS_PROJECT"));

            string projectName = "";
            string state       = "";
            int    templateId  = 0;

            ProjectProperty[] properties = null;

            css.GetProjectProperties(p1.Uri, out projectName, out state, out templateId, out properties);
            Assert.IsNotNull(projectName);
        }