Share via


TaskListCollection.IndexOf(TaskList) Method

Definition

Searches for the specified task list and returns the zero-based index of the first occurrence in the collection.

public:
 int IndexOf(Microsoft::Web::Management::Client::TaskList ^ taskList);
public int IndexOf (Microsoft.Web.Management.Client.TaskList taskList);
member this.IndexOf : Microsoft.Web.Management.Client.TaskList -> int

Parameters

taskList
TaskList

The target element of the TaskListCollection object.

Returns

The zero-based index of the first occurrence of taskList within the entire TaskListCollection object, if found; otherwise, -1.

Examples

The following example sends the index of the _dhTaskList member to the trace listener. The example then creates the following output text:

The index of member _dhTaskList is 0

public void tIndxOf() {

    // Create a initialized collection
    TaskListCollection tlc = Tasks;

    Trace.WriteLine("The index of member _dhTaskList is " +
        tlc.IndexOf(_dhTaskList).ToString());

}

Applies to