TaskItems2 Interface
Visual Studio 2015
The TaskItems collection contains all of the tasks in the Task List window.
Assembly: EnvDTE80 (in EnvDTE80.dll)
| Name | Description | |
|---|---|---|
![]() | Add(String, String, String, vsTaskPriority, Object, Boolean, String, Int32, Boolean, Boolean) | Adds a new task item to the TaskList. |
![]() | Add2(String, String, String, Int32, Object, Boolean, String, Int32, Boolean, Boolean, Boolean) | Adds a new task item to the TaskList. |
![]() | ForceItemsToTaskList() | Sends all task items to the Task List that haven't been added. |
![]() | GetEnumerator() | Gets an enumeration for items in a collection. |
![]() | Item(Object) | Returns an indexed member of a TaskItems collection. |
using EnvDTE; using EnvDTE80; using System.Windows.Forms; public void TaskItems2Example(DTE2 dte) { Window2 win = (Window2)_applicationObject.Windows.Item (Constants.vsWindowKindTaskList); TaskList TL = (TaskList)win.Object; TaskItem TLItem; TaskItems2 TLItems; TLItems = (TaskItems2)TL.TaskItems; // Add a couple of tasks to the Task List. TLItem = TLItems.Add("MyTask", "MyTask1", "Test task 1." , vsTaskPriority.vsTaskPriorityHigh, vsTaskIcon.vsTaskIconUser , true,null,10,true,true ); TLItem = TLItems.Add("MyTask", "MyTask1", "Test task 2." , vsTaskPriority.vsTaskPriorityLow, vsTaskIcon.vsTaskIconComment , true, null, 20, true, true); // List the total number of task list items after adding the new // task items. MessageBox.Show("Task Item 1 description: " + TLItems.Item(2).Description); MessageBox.Show("Total number of task items: " + TLItems.Count.ToString()); // Remove the second task item. // The items list in reverse numeric order. MessageBox.Show("Deleting the second task item"); TLItems.Item(1).Delete(); MessageBox.Show("Total number of task items: " + TLItems.Count); }
Show:

