added methods to wit recycle bin samples
This commit is contained in:
Родитель
fc7960a62c
Коммит
0ec65c4799
|
@ -37,6 +37,18 @@ namespace Microsoft.TeamServices.Samples.Client.WorkItemTracking
|
|||
return result;
|
||||
}
|
||||
|
||||
[ClientSampleMethod]
|
||||
public List<WorkItemDeleteReference> GetMultipledDeletedWorkItems()
|
||||
{
|
||||
int[] ids = { 72, 73, 81 }; //TODO
|
||||
|
||||
VssConnection connection = Context.Connection;
|
||||
WorkItemTrackingHttpClient workItemTrackingClient = connection.GetClient<WorkItemTrackingHttpClient>();
|
||||
|
||||
List<WorkItemDeleteReference> result = workItemTrackingClient.GetDeletedWorkItemsAsync(ids).Result;
|
||||
return result;
|
||||
}
|
||||
|
||||
[ClientSampleMethod]
|
||||
public WorkItemDelete RestoreWorkItem()
|
||||
{
|
||||
|
@ -54,6 +66,26 @@ namespace Microsoft.TeamServices.Samples.Client.WorkItemTracking
|
|||
return result;
|
||||
}
|
||||
|
||||
[ClientSampleMethod]
|
||||
public void RestoreMultipleWorkItems()
|
||||
{
|
||||
int[] ids = { 72, 73, 81 }; //TODO
|
||||
|
||||
VssConnection connection = Context.Connection;
|
||||
WorkItemTrackingHttpClient workItemTrackingClient = connection.GetClient<WorkItemTrackingHttpClient>();
|
||||
|
||||
List<WorkItemDeleteReference> result = workItemTrackingClient.GetDeletedWorkItemsAsync(ids).Result;
|
||||
|
||||
WorkItemDeleteUpdate updateParameters = new WorkItemDeleteUpdate() {
|
||||
IsDeleted = false
|
||||
};
|
||||
|
||||
foreach (var item in result)
|
||||
{
|
||||
var restore = workItemTrackingClient.RestoreWorkItemAsync(updateParameters, Convert.ToInt32(item.Id)).Result;
|
||||
}
|
||||
}
|
||||
|
||||
[ClientSampleMethod]
|
||||
public void PermenentlyDeleteWorkItem()
|
||||
{
|
||||
|
@ -63,6 +95,22 @@ namespace Microsoft.TeamServices.Samples.Client.WorkItemTracking
|
|||
WorkItemTrackingHttpClient workItemTrackingClient = connection.GetClient<WorkItemTrackingHttpClient>();
|
||||
|
||||
workItemTrackingClient.DestroyWorkItemAsync(workItemId);
|
||||
}
|
||||
}
|
||||
|
||||
[ClientSampleMethod]
|
||||
public void PermenentlyDeleteMultipleWorkItems()
|
||||
{
|
||||
int[] ids = { 72, 73, 81 }; //TODO
|
||||
|
||||
VssConnection connection = Context.Connection;
|
||||
WorkItemTrackingHttpClient workItemTrackingClient = connection.GetClient<WorkItemTrackingHttpClient>();
|
||||
|
||||
List<WorkItemDeleteReference> result = workItemTrackingClient.GetDeletedWorkItemsAsync(ids).Result;
|
||||
|
||||
foreach(var item in result)
|
||||
{
|
||||
workItemTrackingClient.DestroyWorkItemAsync(Convert.ToInt32(item.Id));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче