public async Task GetAllTeamProjectsWITypes() { try { TeamProjectInfo[] teamProjects = CurrentProjectCollection.TeamProjectInfos; Progress.BeginWorking(teamProjects.Length); foreach (var teamProject in teamProjects) { try { await GetWITypes(teamProject); Progress.NextStep(); } catch (WitAdminException) { Progress.FailStep(); } } } finally { Progress.EndWorking(); } }
private async Task GetWITypes(TeamProjectInfo teamProject) { string projectCollectionName = CurrentProjectCollection.Name; string teamProjectName = teamProject.Name; WorkItemTypeInfo[] workItemTypeInfos = null; Progress.BeginWorking(); try { try { workItemTypeInfos = (await WitAdminService.ExportWorkItemTypes(TFManager, projectCollectionName, teamProjectName)) .Select(workItemTypeString => new WorkItemTypeInfo() { Name = workItemTypeString, Defenition = null }) .ToArray(); Progress.NextStep(); } catch (WitAdminException) { Progress.FailStep(); } teamProject.WorkItemTypeInfos = workItemTypeInfos; } finally { Progress.EndWorking(); } }
private async Task <List <ProjectCollectionInfo> > GetProjectCollectionInfos(ITFManager tfManager) { var projectCollectionInfos = new List <ProjectCollectionInfo>(); Progress.BeginWorking(); try { await Task.Run(() => { var projectCollections = tfManager.ProjectCollections; var teamProjects = tfManager.TeamProjects; foreach (var projectCollection in projectCollections) { var teamProjectInfos = teamProjects[projectCollection.Key] .Select(teamProjectItem => new TeamProjectInfo() { Name = teamProjectItem.Name, WorkItemTypeInfos = null, Categories = null, ProcessConfig = null } ).ToArray(); var projColInfo = new ProjectCollectionInfo() { Name = projectCollection.Key, TeamProjectInfos = teamProjectInfos }; projectCollectionInfos.Add(projColInfo); } }); Progress.NextStep(); } finally { Progress.EndWorking(); } return(projectCollectionInfos.ToList()); }