共用方式為


TaskItem 介面

更新:2007 年 11 月

TaskItem 物件代表 [工作清單] 視窗中的工作項目。

命名空間:  EnvDTE
組件:  EnvDTE (在 EnvDTE.dll 中)

語法

<GuidAttribute("58E4D419-6B8C-4C63-92DE-70161CD95890")> _
Public Interface TaskItem

Dim instance As TaskItem
[GuidAttribute("58E4D419-6B8C-4C63-92DE-70161CD95890")]
public interface TaskItem
[GuidAttribute(L"58E4D419-6B8C-4C63-92DE-70161CD95890")]
public interface class TaskItem
public interface TaskItem

範例

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

請參閱

參考

TaskItem 成員

EnvDTE 命名空間