-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ready for use #2 - background working is still remained - destroy work item defenition is added
- Loading branch information
1 parent
5dc8359
commit 804215b
Showing
11 changed files
with
213 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using TfsWitAdminTools.Model; | ||
|
||
namespace TfsWitAdminTools.ViewModel | ||
{ | ||
public class WIDDestroyVM : ToolsChildVM | ||
{ | ||
#region Ctor | ||
|
||
public WIDDestroyVM(ToolsVM tools) | ||
: base(tools) | ||
{ | ||
DestroyCommand = new DelegateCommand(() => | ||
{ | ||
//ToDo | ||
try | ||
{ | ||
Tools.IsWorrking = true; | ||
Destroy(); | ||
} | ||
finally | ||
{ | ||
if (Tools.IsWorrking) | ||
Tools.IsWorrking = false; | ||
} | ||
}, | ||
() => ( | ||
Tools.CurrentProjectCollection != null && | ||
(IsAllTeamProjects == true || Tools.CurrentTeamProject != null) && | ||
Tools.CurrentWorkItemType != null | ||
) | ||
); | ||
} | ||
|
||
private void Destroy() | ||
{ | ||
TeamProjectInfo[] teamProjects = null; | ||
if (IsAllTeamProjects) | ||
teamProjects = Tools.CurrentProjectCollection.TeamProjectInfos; | ||
else | ||
teamProjects = new TeamProjectInfo[] { Tools.CurrentTeamProject }; | ||
|
||
foreach (TeamProjectInfo teamProject in teamProjects) | ||
{ | ||
string projectCollectionName = Tools.CurrentProjectCollection.Name; | ||
string teamProjectName = teamProject.Name; | ||
string workItemTypeName = Tools.CurrentWorkItemType.Name; | ||
|
||
Tools.WIAdminService.DestroyWorkItem(TFManager, projectCollectionName, teamProjectName, workItemTypeName); | ||
} | ||
} | ||
|
||
#endregion | ||
|
||
#region Props | ||
|
||
private bool _isAllTeamProjects; | ||
public bool IsAllTeamProjects | ||
{ | ||
get { return _isAllTeamProjects; } | ||
set | ||
{ | ||
if (Set(ref _isAllTeamProjects, value)) | ||
DestroyCommand.RaiseCanExecuteChanged(); | ||
} | ||
} | ||
|
||
#endregion | ||
|
||
#region Commands | ||
|
||
public DelegateCommand DestroyCommand { get; set; } | ||
|
||
|
||
#endregion | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters