From 09572f739d2ab036e9982a1300b15ad9ae66b5ba Mon Sep 17 00:00:00 2001 From: mahdiehsanifar Date: Sun, 18 Oct 2015 14:49:40 +0330 Subject: [PATCH] 0.10.0.0 - Ready For Use #3 Process config part is added --- TfsWitAdminTools/App.xaml.cs | 9 +- TfsWitAdminTools/Core/IWitAdminService.cs | 8 ++ TfsWitAdminTools/Model/TeamProjectInfo.cs | 10 ++ TfsWitAdminTools/Service/WitAdminService.cs | 20 +++ TfsWitAdminTools/TfsWitAdminTools.csproj | 9 +- TfsWitAdminTools/UserControls/ToolsForm.xaml | 63 +++++++-- .../UserControls/ToolsForm.xaml.cs | 3 +- .../ViewModel/CategoriesExportVM.cs | 126 +++++++++++++++++ .../ViewModel/CategoriesImportVM.cs | 112 +++++++++++++++ ...egoryViewerVM.cs => CategoriesViewerVM.cs} | 77 ++++++----- .../ViewModel/CategoryExportVM.cs | 84 ------------ .../ViewModel/CategoryImportVM.cs | 67 --------- .../ViewModel/ProcessConfigExportVM.cs | 129 ++++++++++++++++++ .../ViewModel/ProcessConfigImportVM.cs | 115 ++++++++++++++++ .../ViewModel/ProcessConfigViewerVM.cs | 45 ++++++ TfsWitAdminTools/ViewModel/ToolsVM.cs | 98 ++++++++++--- TfsWitAdminTools/ViewModel/WIDExportVM.cs | 2 +- 17 files changed, 746 insertions(+), 231 deletions(-) create mode 100644 TfsWitAdminTools/ViewModel/CategoriesExportVM.cs create mode 100644 TfsWitAdminTools/ViewModel/CategoriesImportVM.cs rename TfsWitAdminTools/ViewModel/{CategoryViewerVM.cs => CategoriesViewerVM.cs} (76%) delete mode 100644 TfsWitAdminTools/ViewModel/CategoryExportVM.cs delete mode 100644 TfsWitAdminTools/ViewModel/CategoryImportVM.cs create mode 100644 TfsWitAdminTools/ViewModel/ProcessConfigExportVM.cs create mode 100644 TfsWitAdminTools/ViewModel/ProcessConfigImportVM.cs create mode 100644 TfsWitAdminTools/ViewModel/ProcessConfigViewerVM.cs diff --git a/TfsWitAdminTools/App.xaml.cs b/TfsWitAdminTools/App.xaml.cs index 2b00622..549d262 100644 --- a/TfsWitAdminTools/App.xaml.cs +++ b/TfsWitAdminTools/App.xaml.cs @@ -40,9 +40,12 @@ private void Application_Startup(object sender, StartupEventArgs e) DiManager.Current.Register(lifeCycle: LifeCycle.Transient); DiManager.Current.Register(lifeCycle: LifeCycle.Transient); DiManager.Current.Register(lifeCycle: LifeCycle.Transient); - DiManager.Current.Register(lifeCycle: LifeCycle.Transient); - DiManager.Current.Register(lifeCycle: LifeCycle.Transient); - DiManager.Current.Register(lifeCycle: LifeCycle.Transient); + DiManager.Current.Register(lifeCycle: LifeCycle.Transient); + DiManager.Current.Register(lifeCycle: LifeCycle.Transient); + DiManager.Current.Register(lifeCycle: LifeCycle.Transient); + DiManager.Current.Register(lifeCycle: LifeCycle.Transient); + DiManager.Current.Register(lifeCycle: LifeCycle.Transient); + DiManager.Current.Register(lifeCycle: LifeCycle.Transient); } } } diff --git a/TfsWitAdminTools/Core/IWitAdminService.cs b/TfsWitAdminTools/Core/IWitAdminService.cs index 5e5f08d..0c27826 100644 --- a/TfsWitAdminTools/Core/IWitAdminService.cs +++ b/TfsWitAdminTools/Core/IWitAdminService.cs @@ -27,6 +27,14 @@ void ExportWorkItemDefenition(ITFManager tfManager, string projectCollectionName void ImportCategories(ITFManager tfManager, string projectCollectionName, string teamProjectName, string fileName); + string ExportProcessConfig(ITFManager tfManager, string projectCollectionName, string teamProjectName); + + + void ExportProcessConfig(ITFManager tfManager, string projectCollectionName, string teamProjectName, string fileName); + + + void ImportProcessConfig(ITFManager tfManager, string projectCollectionName, string teamProjectName, string fileName); + string InvokeCommand(string argument, bool isConfirmRequired = false); Task InvokeCommandWithSplitedResult(string argument, bool isConfirmRequired = false); diff --git a/TfsWitAdminTools/Model/TeamProjectInfo.cs b/TfsWitAdminTools/Model/TeamProjectInfo.cs index cdf1632..f843211 100644 --- a/TfsWitAdminTools/Model/TeamProjectInfo.cs +++ b/TfsWitAdminTools/Model/TeamProjectInfo.cs @@ -33,5 +33,15 @@ public string Categories SetValue(ref _categories, value); } } + + private string _processConfig; + public string ProcessConfig + { + get { return _processConfig; } + set + { + SetValue(ref _processConfig, value); + } + } } } diff --git a/TfsWitAdminTools/Service/WitAdminService.cs b/TfsWitAdminTools/Service/WitAdminService.cs index 6eb63d6..6a0fbc2 100644 --- a/TfsWitAdminTools/Service/WitAdminService.cs +++ b/TfsWitAdminTools/Service/WitAdminService.cs @@ -84,6 +84,26 @@ public void ImportCategories(ITFManager tfManager, string projectCollectionName, string argument = string.Format("importcategories /collection:{0}/{1} /p:{2} /f:\"{3}\"", tfManager.TfsAddress, projectCollectionName, teamProjectName, fileName); InvokeCommand(argument); } + + public string ExportProcessConfig(ITFManager tfManager, string projectCollectionName, string teamProjectName) + { + string argument = string.Format("exportprocessconfig /collection:{0}/{1} /p:{2}", tfManager.TfsAddress, projectCollectionName, teamProjectName); + string result = InvokeCommand(argument); + + return result; + } + + public void ExportProcessConfig(ITFManager tfManager, string projectCollectionName, string teamProjectName, string fileName) + { + string argument = string.Format("exportprocessconfig /collection:{0}/{1} /p:{2} /f:\"{3}\"", tfManager.TfsAddress, projectCollectionName, teamProjectName, fileName); + InvokeCommand(argument); + } + + public void ImportProcessConfig(ITFManager tfManager, string projectCollectionName, string teamProjectName, string fileName) + { + string argument = string.Format("importprocessconfig /collection:{0}/{1} /p:{2} /f:\"{3}\"", tfManager.TfsAddress, projectCollectionName, teamProjectName, fileName); + InvokeCommand(argument); + } #endregion diff --git a/TfsWitAdminTools/TfsWitAdminTools.csproj b/TfsWitAdminTools/TfsWitAdminTools.csproj index 5ca60cb..c637a71 100644 --- a/TfsWitAdminTools/TfsWitAdminTools.csproj +++ b/TfsWitAdminTools/TfsWitAdminTools.csproj @@ -103,11 +103,14 @@ ToolsForm.xaml - - - + + + + + + diff --git a/TfsWitAdminTools/UserControls/ToolsForm.xaml b/TfsWitAdminTools/UserControls/ToolsForm.xaml index a8b1ed3..0f97e63 100644 --- a/TfsWitAdminTools/UserControls/ToolsForm.xaml +++ b/TfsWitAdminTools/UserControls/ToolsForm.xaml @@ -43,7 +43,7 @@ - + @@ -54,7 +54,7 @@ - + @@ -102,34 +102,71 @@ - - + + - +