다음을 통해 공유


TaskItems2 Interface

Definition

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

public interface class TaskItems2 : EnvDTE::TaskItems
public interface class TaskItems2 : EnvDTE::TaskItems, System::Collections::IEnumerable
public interface class TaskItems2 : EnvDTE::TaskItems
__interface TaskItems2 : EnvDTE::TaskItems
[System.Runtime.InteropServices.Guid("B820F931-645A-473F-8246-922CF069E1FE")]
[System.Runtime.InteropServices.TypeLibType(4160)]
public interface TaskItems2 : EnvDTE.TaskItems
[System.Runtime.InteropServices.Guid("B820F931-645A-473F-8246-922CF069E1FE")]
public interface TaskItems2 : EnvDTE.TaskItems, System.Collections.IEnumerable
[<System.Runtime.InteropServices.Guid("B820F931-645A-473F-8246-922CF069E1FE")>]
[<System.Runtime.InteropServices.TypeLibType(4160)>]
type TaskItems2 = interface
    interface TaskItems
[<System.Runtime.InteropServices.Guid("B820F931-645A-473F-8246-922CF069E1FE")>]
type TaskItems2 = interface
    interface TaskItems
    interface IEnumerable
Public Interface TaskItems2
Implements TaskItems
Public Interface TaskItems2
Implements IEnumerable, TaskItems
Attributes
Implements

Examples

Imports EnvDTE  
Imports EnvDTE80  
Sub TaskItems2Example(ByVal dte As DTE2)  
    Dim win As Window = _applicationObject.Windows.Item _  
     (Constants.vsWindowKindTaskList)  
    Dim TL As TaskList = CType(win.Object, TaskList)  
    Dim TLItem As TaskItem  
    Dim TLItems As TaskItems2  
    TLItems = CType(TL.TaskItems, TaskItems2)  
    ' Add a couple of tasks to the Task List.  
    TLItem = TLItems.Add(" ", " ", "Test task 1.", _  
     vsTaskPriority.vsTaskPriorityHigh, vsTaskIcon.vsTaskIconUser _  
    , True, , 10, , )  
     TLItem = TLItems.Add(" ", " ", "Test task 2." _  
    , vsTaskPriority.vsTaskPriorityLow, vsTaskIcon.vsTaskIconComment _  
    , , , 20, , )  
    ' List the total number of task list items after adding the new   
    ' task items.  
    MsgBox("Task Item 1 description: " & TLItems.Item(2).Description)  
    MsgBox("Total number of task items: " & TLItems.Count)  
    ' Remove the second task item.  
    ' The items list in reverse numeric order.  
    MsgBox("Deleting the second task item")  
    TLItems.Item(1).Delete()  
    MsgBox("Total number of task items: " & TLItems.Count)  
End Sub  
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);  
}  

Properties

Count

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

DTE

Gets the top-level extensibility object.

Parent

Gets the immediate parent object of a TaskItems collection.

Methods

Add(String, String, String, vsTaskPriority, Object, Boolean, String, Int32, Boolean, Boolean)
Add2(String, String, String, Int32, Object, Boolean, String, Int32, Boolean, Boolean, Boolean)

Adds a new task item to the TaskList.

Add2(String, String, String, vsTaskPriority, Object, Boolean, String, Int32, Boolean, Boolean, Boolean)
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.

Applies to