Partager via


TaskItems, interface

Mise à jour : novembre 2007

La collection TaskItems contient toutes les tâches de la fenêtre Liste des tâches.

Espace de noms :  EnvDTE
Assembly :  EnvDTE (dans EnvDTE.dll)

Syntaxe

<GuidAttribute("4B51103D-513C-4773-B56A-354D0928FD04")> _
Public Interface TaskItems _
    Implements IEnumerable

Dim instance As TaskItems
[GuidAttribute("4B51103D-513C-4773-B56A-354D0928FD04")]
public interface TaskItems : IEnumerable
[GuidAttribute(L"4B51103D-513C-4773-B56A-354D0928FD04")]
public interface class TaskItems : IEnumerable
public interface TaskItems extends IEnumerable

Exemples

Sub TaskItemsCollectionExample()
   Dim win As Window = DTE.Windows.Item(Constants.vsWindowKindTaskList)
   Dim TL As TaskList = win.Object
   Dim TLItem As TaskItem

   ' Add a couple of tasks to the Task List.
   TLItem = TL.TaskItems.Add(" ", " ", "Test task 1.", vsTaskPriority.vsTaskPriorityHigh, vsTaskIcon.vsTaskIconUser, True, , 10, , )
   TLItem = TL.TaskItems.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: " & TL.TaskItems.Item(2).Description)
   MsgBox("Total number of task items: " & TL.TaskItems.Count)

   ' Remove the second task item. The items list in reverse numeric order.
   MsgBox("Deleting the second task item")
   TL.TaskItems.Item(1).Delete()
   MsgBox("Total number of task items: " & TL.TaskItems.Count)
End Sub

Voir aussi

Référence

Membres TaskItems

EnvDTE, espace de noms