Share via


TaskListCollection.Remove(TaskList) Method

Definition

Removes the first occurrence of a specific object from the task list collection.

public:
 void Remove(Microsoft::Web::Management::Client::TaskList ^ taskList);
public void Remove (Microsoft.Web.Management.Client.TaskList taskList);
member this.Remove : Microsoft.Web.Management.Client.TaskList -> unit

Parameters

taskList
TaskList

The TaskList object to remove from the TaskListCollection object.

Examples

The following example demonstrates the Add and Remove methods.

public void tTLCaddRm() {

    TaskListCollection tlc = new TaskListCollection();
    Trace.WriteLine("tlc.Count = " + tlc.Count.ToString());
    tlc.Add(_dhTaskList);
    Trace.WriteLine("After Add tlc.Count = " + tlc.Count.ToString());
    tlc.Remove(_dhTaskList);
    Trace.WriteLine("After Remove tlc.Count = " + tlc.Count.ToString());

}

Remarks

If the TaskListCollection object does not contain the specified TaskList object, the TaskListCollection remains unchanged. No exception is thrown.

Applies to