Condividi tramite


Proprietà TaskList.DefaultCommentToken

Ottiene la stringa predefinita per l'aggiunta di attività nella finestra Elenco attività.

Spazio dei nomi:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Sintassi

'Dichiarazione
ReadOnly Property DefaultCommentToken As String
    Get
string DefaultCommentToken { get; }
property String^ DefaultCommentToken {
    String^ get ();
}
abstract DefaultCommentToken : string
function get DefaultCommentToken () : String

Valore proprietà

Tipo: System.String
La stringa predefinita per l'aggiunta di attività nella finestra Elenco attività.

Note

È possibile utilizzare token di commento per l'aggiunta di attività nell'ambiente di sviluppo integrato (IDE) di Visual Studio. Immettendo il nome del token come nota nel codice, verrà automaticamente creata e aggiunta un'attività nella finestra Elenco attività.

Il primo carattere di un token deve essere il primo carattere alfanumerico nella riga del commento. Il token deve essere seguito da almeno uno spazio vuoto o da un carattere non alfanumerico.

È ad esempio possibile aggiungere la seguente riga:

   'HACK: è necessario ottimizzare il ciclo.

Se "HACK" è un token valido, la stringa viene aggiunta come nuova attività nella finestra Elenco attività.

Il token di commento predefinito restituito da questa proprietà è TODO e non può essere modificato.

Esempi

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

Sicurezza di .NET Framework

Vedere anche

Riferimenti

TaskList Interfaccia

Spazio dei nomi EnvDTE