TaskItems2 Interface

 

The TaskItems collection contains all of the tasks in the Task List window.

Namespace:   EnvDTE80
Assembly:  EnvDTE80 (in EnvDTE80.dll)

[GuidAttribute("B820F931-645A-473F-8246-922CF069E1FE")]
public interface TaskItems2 : TaskItems

NameDescription
System_CAPS_pubpropertyCount

Gets a value indicating the number of objects in the collection.

System_CAPS_pubpropertyDTE

Gets the top-level extensibility object.

System_CAPS_pubpropertyParent

Gets the immediate parent object of a TaskItems collection.

NameDescription
System_CAPS_pubmethodAdd(String, String, String, vsTaskPriority, Object, Boolean, String, Int32, Boolean, Boolean)

Adds a new task item to the TaskList.

System_CAPS_pubmethodAdd2(String, String, String, Int32, Object, Boolean, String, Int32, Boolean, Boolean, Boolean)

Adds a new task item to the TaskList.

System_CAPS_pubmethodForceItemsToTaskList()

Sends all task items to the Task List that haven't been added.

System_CAPS_pubmethodGetEnumerator()

Gets an enumeration for items in a collection.

System_CAPS_pubmethodItem(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);
}
Return to top
Show: