/// <summary> /// Deletes the specified task /// </summary> /// <param name="parameters">The parameters indicating which task to delete</param> public void DeleteTask(TaskOperationParameters parameters) { if (parameters == null) { throw new ArgumentNullException("parameters"); } if (parameters.Task != null) { parameters.Task.omObject.Delete(parameters.AdditionalBehaviors); } else { using (IWorkItemManager wiManager = parameters.Context.BatchOMClient.OpenWorkItemManager()) { wiManager.DeleteTask(parameters.WorkItemName, parameters.JobName, parameters.TaskName, parameters.AdditionalBehaviors); } } }
/// <summary> /// Deletes the specified Task /// </summary> /// <param name="parameters">The parameters indicating which Task to delete</param> public void DeleteTask(RemoveTaskParameters parameters) { if (parameters == null) { throw new ArgumentNullException("parameters"); } if ((string.IsNullOrWhiteSpace(parameters.WorkItemName) || string.IsNullOrWhiteSpace(parameters.JobName) || string.IsNullOrWhiteSpace(parameters.TaskName)) && parameters.Task == null) { throw new ArgumentException(Resources.RBT_NoTaskSpecified); } if (parameters.Task != null) { parameters.Task.omObject.Delete(parameters.AdditionalBehaviors); } else { using (IWorkItemManager wiManager = parameters.Context.BatchOMClient.OpenWorkItemManager()) { wiManager.DeleteTask(parameters.WorkItemName, parameters.JobName, parameters.TaskName, parameters.AdditionalBehaviors); } } }