Export (0) Print
Expand All
ID
Top
Expand Minimize
This topic has not yet been rated - Rate this topic

DefaultCommentToken Property

Visual Studio .NET 2003

Returns the default string for adding tasks to the Task List window.

[Visual Basic .NET]
Public ReadOnly Property DefaultCommentToken() As String
[Visual Basic 6]
Property Get DefaultCommentToken() As String
[C++]
HRESULT __stdcall get_DefaultCommentToken(
   /* [out, retval] */ BSTR* retVal
);
[C#]
public string DefaultCommentToken {get;}
[JScript .NET]
public function get DefaultCommentToken() : String

Remarks

You can use comment tokens to add tasks to your Visual Studio environment. By entering that token name as a remark in your code, a task is automatically created and added to the Task List window.

The first character of a token must be the first alphanumeric character in the comment line, and the token must be followed by at least one white space character or non-alphanumeric character.

For example, you might add this line:

   'HACK: Need to optimize this loop.

If "HACK" is a valid token, the string is added to the Task List window as a new task item.

The default comment token, returned by this property, is "TODO" and cannot be changed.

Example

This example retrieves the DefaultCommentToken for the task list:

Sub DefaultCommentTokenExample()
   ' Before running, add a task to the Task List.
   Dim win As Window = DTE.Windows.Item(Constants.vsWindowKindTaskList)
   Dim TL As TaskList = win.Object
   Dim TLItem As TaskItem = TL.TaskItems.Item(1)
   Dim msg As String

   'List properties of the Task Item.
   msg = "TaskItem Category property value: " & TLItem.Category & vbCr
   msg = msg & "TaskItem SubCategory property value: " & TLItem.SubCategory & vbCr
   msg = msg & "TaskItem DefaultCommentToken property value: " & TL.DefaultCommentToken & vbCr
   msg = msg & "TaskItem Checked property value: " & TLItem.Checked & vbCr
   msg = msg & "TaskItem Displayed property value: " & TLItem.Displayed & vbCr
   msg = msg & "TaskItem IsSettable property value: " & TLItem.IsSettable(vsTaskListColumn.vsTaskListColumnCheck) & vbCr
   msg = msg & "TaskItem Priority property value: " & TLItem.Priority & vbCr
   MsgBox(msg)
End Sub

See Also

Applies To: TaskList Object

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.