Inheritance: PropertyNotifyObject
Ejemplo n.º 1
0
        private async Task Destroy()
        {
            TeamProjectInfo[] teamProjects = null;
            if (IsAllTeamProjects)
                teamProjects = Tools.CurrentProjectCollection.TeamProjectInfos;
            else
                teamProjects = new TeamProjectInfo[] { Tools.CurrentTeamProject };

            Tools.Progress.BeginWorking(teamProjects.Length);
            try
            {
                foreach (TeamProjectInfo teamProject in teamProjects)
                {
                    string projectCollectionName = Tools.CurrentProjectCollection.Name;
                    string teamProjectName = teamProject.Name;
                    string workItemTypeName = Tools.CurrentWorkItemType.Name;

                    try
                    {
                        await Tools.WitAdminService.DestroyWorkItem(TFManager, projectCollectionName, teamProjectName, workItemTypeName);
                        Tools.Progress.NextStep();
                    }
                    catch (WitAdminException)
                    {
                        Tools.Progress.FailStep();
                    }
                }
            }
            finally
            {
                Tools.Progress.EndWorking();
            }
        }
        private async Task Export(ProjectCollectionInfo projectCollection, TeamProjectInfo teamProject, string path)
        {
            string projectCollectionName = projectCollection.Name;
            string teamProjectName = teamProject.Name;

            string fileName = string.Format("{0}.xml", teamProjectName);
            string fullPath = System.IO.Path.Combine(path, fileName);

            await Tools.WitAdminService.ExportCategories(TFManager, projectCollectionName, teamProjectName, fullPath);
        }
Ejemplo n.º 3
0
        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 Import(ProjectCollectionInfo projectCollection, TeamProjectInfo teamProject, string fileName)
        {
            string projectCollectionName = projectCollection.Name;
            string teamProjectName = teamProject.Name;

            await Tools.WitAdminService.ImportProcessConfig(TFManager, projectCollectionName, teamProjectName, fileName);
        }
Ejemplo n.º 5
0
        private async Task Export()
        {
            ProjectCollectionInfo projectCollection = Tools.CurrentProjectCollection;

            TeamProjectInfo[] teamProjects;

            if (IsAllTeamProjects)
            {
                teamProjects = projectCollection.TeamProjectInfos;

                foreach (TeamProjectInfo teamProject in teamProjects)
                {
                    if (teamProject.WorkItemTypeInfos == null)
                    {
                        await Tools.GetAllTeamProjectsWITypes();
                        break;
                    }
                }
            }
            else
                teamProjects = new TeamProjectInfo[] { Tools.CurrentTeamProject };

            foreach (TeamProjectInfo teamProject in teamProjects)
            {
                WorkItemTypeInfo[] workItemTypeInfos;
                string path = Path;

                if (IsAllTeamProjects)
                {
                    path = System.IO.Path.Combine(path, teamProject.Name);
                    System.IO.Directory.CreateDirectory(path);
                }

                workItemTypeInfos = (IsAllWorkItemTypes)
                    ? teamProject.WorkItemTypeInfos
                    : workItemTypeInfos = new WorkItemTypeInfo[] { Tools.CurrentWorkItemType };

                Tools.Progress.BeginWorking(workItemTypeInfos.Length);
                try
                {
                    foreach (WorkItemTypeInfo workItemTypeInfo in workItemTypeInfos)
                    {
                        try
                        {
                            await Export(projectCollection, teamProject, workItemTypeInfo, path);
                            Tools.Progress.NextStep();
                        }
                        catch (WitAdminException)
                        {
                            Tools.Progress.FailStep();
                        }
                    }
                }
                finally
                {
                    Tools.Progress.EndWorking();
                }
            }
        }
Ejemplo n.º 6
0
        private async Task Export(ProjectCollectionInfo projectCollection, TeamProjectInfo teamProject, WorkItemTypeInfo workItemType, string path)
        {
            string projectCollectionName = projectCollection.Name;
            string teamProjectName = teamProject.Name;
            string workItemTypeName = workItemType.Name;

            string fileName = string.Format("{0}.xml", workItemTypeName);
            string fullPath = System.IO.Path.Combine(path, fileName);

            await Tools.WitAdminService.ExportWorkItemDefenition(TFManager, projectCollectionName, teamProjectName,
                workItemTypeName, fullPath);
        }