Anteckning
Åtkomst till den här sidan kräver auktorisering. Du kan prova att logga in eller ändra kataloger.
Åtkomst till den här sidan kräver auktorisering. Du kan prova att ändra kataloger.
The TaskItem object represents a task item in the Task List window.
Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)
Syntax
'Declaration
<GuidAttribute("58E4D419-6B8C-4C63-92DE-70161CD95890")> _
Public Interface TaskItem
[GuidAttribute("58E4D419-6B8C-4C63-92DE-70161CD95890")]
public interface TaskItem
[GuidAttribute(L"58E4D419-6B8C-4C63-92DE-70161CD95890")]
public interface class TaskItem
[<GuidAttribute("58E4D419-6B8C-4C63-92DE-70161CD95890")>]
type TaskItem =  interface end
public interface TaskItem
The TaskItem type exposes the following members.
Properties
| Name | Description | |
|---|---|---|
![]()  | 
Category | Gets a string representing the category of the task item. | 
![]()  | 
Checked | Sets or gets whether a task item in the Task List window has a check in the check box column. | 
![]()  | 
Collection | Returns the collection containing the TaskItem object supporting this property. | 
![]()  | 
Description | Sets or gets a string that represents the description for the TaskItem object. | 
![]()  | 
Displayed | Gets whether the task item is currently visible in the Task List window. | 
![]()  | 
DTE | Gets the top-level extensibility object. | 
![]()  | 
FileName | Sets or gets a string representing the file name that was passed to the Task List window when the task item was created. | 
![]()  | 
IsSettable | Returns whether a given column of a task item can be edited. | 
![]()  | 
Line | Sets or gets the line number of the TaskItem object. | 
![]()  | 
Priority | Sets or gets a constant that indicates the priority of the task item. | 
![]()  | 
SubCategory | Gets a string representing the task item's subcategory. | 
Top
Methods
| Name | Description | |
|---|---|---|
![]()  | 
Delete | Removes the task item from the collection. | 
![]()  | 
Navigate | Requests that the task item navigate to its location and display it, if that is meaningful to the task. | 
![]()  | 
Select | Causes this item to become active in the integrated development environment (IDE). | 
Top
Examples
In the following example, the tasks appear in the Add-ins and Macros category of the Task List.
[Visual Basic]
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
.gif)
.gif)