Udostępnij za pośrednictwem


IDTCommandTarget.QueryStatus Method

Definition

Returns the current status (enabled, disabled, hidden, and so forth) of the specified named command.

public:
 void QueryStatus(System::String ^ CmdName, EnvDTE::vsCommandStatusTextWanted NeededText, [Runtime::InteropServices::Out] EnvDTE::vsCommandStatus % StatusOption, [Runtime::InteropServices::Out] System::Object ^ % CommandText);
void QueryStatus(std::wstring const & CmdName, EnvDTE::vsCommandStatusTextWanted NeededText, [Runtime::InteropServices::Out] EnvDTE::vsCommandStatus & StatusOption, [Runtime::InteropServices::Out] winrt::Windows::Foundation::IInspectable const & & CommandText);
[System.Runtime.InteropServices.DispId(1)]
public void QueryStatus (string CmdName, EnvDTE.vsCommandStatusTextWanted NeededText, out EnvDTE.vsCommandStatus StatusOption, out object CommandText);
[<System.Runtime.InteropServices.DispId(1)>]
abstract member QueryStatus : string * EnvDTE.vsCommandStatusTextWanted * vsCommandStatus * obj -> unit
Public Sub QueryStatus (CmdName As String, NeededText As vsCommandStatusTextWanted, ByRef StatusOption As vsCommandStatus, ByRef CommandText As Object)

Parameters

CmdName
String

The name of the command to check.

NeededText
vsCommandStatusTextWanted

A vsCommandStatusTextWanted constant specifying if information is returned from the check, and if so, what type of information is returned.

StatusOption
vsCommandStatus

A vsCommandStatus specifying the current status of the command.

CommandText
Object

The text to return if vsCommandStatusTextWantedStatus is specified.

Attributes

Remarks

The following example uses the Command object, its AddNamedCommand and AddControl methods, and the IDTCommandTarget interface and its (Exec and QueryStatus) methods, to demonstrate how to make a command appear on the Tools menu in Visual Studio.

Applies to