Partilhar via


Propriedade Command.IsAvailable

Obtém um valor indicando se a Command está habilitada no momento.

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

Sintaxe

'Declaração
ReadOnly Property IsAvailable As Boolean
    Get
bool IsAvailable { get; }
property bool IsAvailable {
    bool get ();
}
abstract IsAvailable : bool
function get IsAvailable () : boolean

Valor de propriedade

Tipo: System.Boolean
Um valor booleano indicando true se o comando está ativado no momento; Caso contrário, false.

Exemplos

' Macro code.
Sub IsAvailableExample()
   ' Before running, you must add a reference to
   ' Microsoft.VisualStudio.CommandBars.
   Dim cmds As Commands
   Dim cmdobj As Command
   Dim customin, customout As Object
   Dim colAddins As AddIns

   ' Set references.
   colAddins = DTE.AddIns()
   cmds = DTE.Commands
   cmdobj = cmds.Item("File.NewFile")

   ' List some of the command properties.
   MsgBox("Command Name: " & cmdobj.Name)
   MsgBox("Is Command Available?: " & cmdobj.IsAvailable)
   MsgBox("Command ID: " & cmdobj.ID)
   MsgBox("Command GUID: " & cmdobj.Guid)
End Sub

Segurança do .NET Framework

Consulte também

Referência

Command Interface

Namespace EnvDTE