Share via


TaskListCollection.Insert(Int32, TaskList) Method

Definition

Inserts an element into the TaskListCollection object at the specified index.

public:
 void Insert(int index, Microsoft::Web::Management::Client::TaskList ^ taskList);
public void Insert (int index, Microsoft.Web.Management.Client.TaskList taskList);
member this.Insert : int * Microsoft.Web.Management.Client.TaskList -> unit

Parameters

index
Int32

The zero-based index at which taskList should be inserted.

taskList
TaskList

The TaskList object to insert.

Exceptions

taskList is null or not a TaskList object.

Examples

The following example inserts a task list into the task list collection.

public override TaskListCollection Tasks
{
    get
    {
        TaskListCollection tlc = base.Tasks;

        if (_dhTaskList == null)
        {
            _dhTaskList = new HierarchyDemoInfoTaskList(this);
        }
        tlc.Insert(0, _dhTaskList);

        return tlc;
    }
}

Applies to