TaskList 接口

更新:2007 年 11 月

TaskList 对象表示 Visual Studio 集成开发环境 (IDE) 内“任务列表”窗口中的项。

命名空间:  EnvDTE
程序集:  EnvDTE(在 EnvDTE.dll 中)

语法

声明
<GuidAttribute("4E4F0569-E16A-4DA1-92DE-10882A4DDD8C")> _
Public Interface TaskList
用法
Dim instance As TaskList
[GuidAttribute("4E4F0569-E16A-4DA1-92DE-10882A4DDD8C")]
public interface TaskList
[GuidAttribute(L"4E4F0569-E16A-4DA1-92DE-10882A4DDD8C")]
public interface class TaskList
public interface TaskList

备注

IDE 中只有一个 TaskList 对象。

示例

Sub TaskListExample()
   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

另请参见

参考

TaskList 成员

EnvDTE 命名空间