Command.IsAvailable プロパティ

更新 : 2007 年 11 月

Command が現在有効であるかどうかを示す値を取得します。

名前空間 :  EnvDTE
アセンブリ :  EnvDTE (EnvDTE.dll 内)

構文

'宣言
ReadOnly Property IsAvailable As Boolean
'使用
Dim instance As Command
Dim value As Boolean

value = instance.IsAvailable
bool IsAvailable { get; }
property bool IsAvailable {
    bool get ();
}
function get IsAvailable () : boolean

プロパティ値

型 : System.Boolean

コマンドが現在有効である場合は true を示し、それ以外の場合は false を示すブール値。

' 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

アクセス許可

  • 直前の呼び出し元に対する完全な信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

参照

Command インターフェイス

Command メンバ

EnvDTE 名前空間