共用方式為


Command.IsAvailable 屬性

取得值,指出 Command 目前是否為啟用。

命名空間:  EnvDTE
組件:  EnvDTE (在 EnvDTE.dll 中)

語法

'宣告
ReadOnly Property IsAvailable As Boolean
bool IsAvailable { get; }
property bool IsAvailable {
    bool get ();
}
abstract IsAvailable : bool with get
function get IsAvailable () : boolean

屬性值

類型:Boolean
如果命令目前為啟用狀態,布林值會表示為 true,否則為 false。

範例

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

.NET Framework 安全性

請參閱

參考

Command 介面

EnvDTE 命名空間