AGI Ui Plugins 11 Send comments on this topic.
QueryState Method (IAgUiPluginCommandTarget)
See Also  Example
CommandName
A named command which status is requested by the hosting environment.





Description

Returns a state of the specified named command.

Syntax

[Visual Basic .NET]
Public Function QueryState( _
   ByVal CommandName As String _
) As AgEUiPluginCommandState

[C#]
public AgEUiPluginCommandState QueryState(
string CommandName
);

[Managed C++]
public: AgEUiPluginCommandState QueryState(
String __gc ^ CommandName
);

[Java]
public AgEUiPluginCommandState queryState(
String CommandName
);

[Unmanaged C++]
public: HRESULT QueryState(
BSTR CommandName,
AgEUiPluginCommandState * ReturnValue
);

Parameters

CommandName
A named command which status is requested by the hosting environment.

Return Type

A bitmask indicating the status of the requested named command.

Remarks

When the hosting environment needs to find out the state of a custom toolbar button or a context menu item added by a User Interface plugin, it calls the QueryState method. The QueryState method returns a bitmask indicating whether the command associated with a button or a menu is supported, enabled or grayed.

Example

Set a status of a named command Copy Code
AgEUiPluginCommandState IAgUiPluginCommandTarget.QueryState(string CommandName) 

    if (string.Compare(CommandName, "MyFirstCommand"true) == 0
    { 
        return AgEUiPluginCommandState.eUiPluginCommandStateEnabled | AgEUiPluginCommandState.eUiPluginCommandStateSupported; 
    } 
    return AgEUiPluginCommandState.eUiPluginCommandStateNone; 


See Also

© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK Programming Interface 11.0.1