Compartilhar via


Propriedade TaskItem.FileName

Define ou obtém uma cadeia de caracteres que representa o nome do arquivo que foi passado para o Lista de tarefas janela quando o item de tarefa foi criado.

Namespace:  EnvDTE
Assembly:  EnvDTE (em EnvDTE.dll)

Sintaxe

'Declaração
Property FileName As String
string FileName { get; set; }
property String^ FileName {
    String^ get ();
    void set (String^ value);
}
abstract FileName : string with get, set
function get FileName () : String 
function set FileName (value : String)

Valor de propriedade

Tipo: String
Um string que representa o nome do arquivo que foi passado para o Lista de tarefas janela quando o item de tarefa foi criado.

Comentários

A seqüência de caracteres vazia é um token especial que indica que não há nenhum nome de arquivo associada ao item de tarefa. O FileName propriedade retorna o erro, o erro não especificado, se não houver nenhum valor para ele (ou seja, nenhum nome de arquivo).

Exemplos

[Visual Basic]

Sub FilenameExample()
   ' 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 Checked property value: " & TLItem.Checked & vbCr
   msg = msg & "TaskItem Displayed property value: " & TLItem.Displayed & vbCr
   ' The following line will fail with an error unless a file is 
   ' associated with the Task Item.
   msg = msg & "TaskItem Filename property value: " & TLItem.FileName & 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

Segurança do .NET Framework

Consulte também

Referência

TaskItem Interface

Namespace EnvDTE