This project has moved. For the latest updates, please go here.

How to delete only action instead of Task

Oct 10, 2011 at 2:45 PM

How to delete only action instead of Task

 

give some exmples

Coordinator
Oct 10, 2011 at 8:25 PM
using (TaskService ts = new TaskService())
{
   // Get an instance of the task
   Task t = ts.GetTask(taskName);
   // Get the task's definition
   td = t.Definition;
   // If there is a second task defined, remove it
   if (td.Actions.Count > 1)
      td.Actions.RemoveAt(1);
   // Register the updated task
   ts.RootFolder.RegisterTaskDefinition(taskName, td);
}