Esempio n. 1
0
        public static IEnumerable <Project> GetTeamProjects(this TfsTeamProjectCollection projColl)
        {
            projColl.NullCheck();
            $"{nameof(GetTeamProjects)}: {nameof(projColl)} = {projColl.Name}".Trace();
            var wis = projColl.GetService <WorkItemStore>();

            for (int i = 0; i < wis.Projects.Count; i++)
            {
                $"{nameof(GetTeamProjects)}: wis.Projects[{i}] = {wis.Projects[i].Name}".Trace();
                yield return(wis.Projects[i]);
            }
        }
Esempio n. 2
0
        public static string GetProjectCollectionName(this TfsTeamProjectCollection pc)
        {
            pc.NullCheck();
            $"{nameof(GetProjectCollectionName)}: {nameof(pc)} = {pc.Name}".Trace();
            var index = pc.Name.LastIndexOf('/') + 1;

            $"{nameof(GetProjectCollectionName)}: {nameof(index)} = {index}".Trace();
            var collName = pc.Name.Substring(index, pc.Name.Length - index);

            $"{nameof(GetProjectCollectionName)}: {nameof(collName)} = {collName}".Trace();
            return(collName);
        }
Esempio n. 3
0
        public static string GetProjectCollectionLocalPath(this TfsTeamProjectCollection pc, string localRoot)
        {
            pc.NullCheck();
            localRoot.NullCheck();
            $"{nameof(GetProjectCollectionLocalPath)}: {nameof(pc)} = {pc.Name}".Trace();
            $"{nameof(GetProjectCollectionLocalPath)}: {nameof(localRoot)} = {localRoot}".Trace();
            var collName = GetProjectCollectionName(pc);

            $"{nameof(GetProjectCollectionLocalPath)}: {nameof(collName)} = {collName}".Trace();
            var basePath = Path.Combine(Environment.CurrentDirectory, localRoot);

            $"{nameof(GetProjectCollectionLocalPath)}: {nameof(basePath)} = {basePath}".Trace();
            var collPath = Path.Combine(basePath, collName);

            $"{nameof(GetProjectCollectionLocalPath)}: {nameof(collPath)} = {collPath}".Trace();
            return(collPath);
        }
Esempio n. 4
0
 public static string GetWorkspaceName(this TfsTeamProjectCollection projColl)
 {
     projColl.NullCheck();
     $"{nameof(GetWorkspaceName)}: {nameof(projColl)} = {projColl.Name}".Trace();
     return($"{Globals.WorkspacePrefix}_{projColl.GetProjectCollectionName()}_{Environment.MachineName}");
 }