Interface ICommandHandler
- Namespace
- CADability.UserInterface
- Assembly
- CADability.dll
Objects that implement this interface can receive menu command. Usually used in calls to LoadMenuDefinition(string, bool, ICommandHandler) to specify the target object for that menu.
public interface ICommandHandler
Methods
OnCommand(string)
Process the command with the given MenuId. Return true if handled, false otherwise.
bool OnCommand(string menuId)
Parameters
menuIdstringId of the menu command to be processed
Returns
- bool
true, if handled, false otherwise
OnSelected(MenuWithHandler, bool)
Notify that the menu item is being selected. No need to react on this notification
void OnSelected(MenuWithHandler selectedMenu, bool selected)
Parameters
selectedMenuMenuWithHandlerId of the menu command that was selected
selectedbooltrue, if selected, false if deselected
OnUpdateCommand(string, CommandState)
Update the command user interface of the given command. Return true if handled, false otherwise.
bool OnUpdateCommand(string menuId, CommandState commandState)
Parameters
menuIdstringId of the menu command to be processed
commandStateCommandStateState object to modify if appropriate
Returns
- bool
true, if handled, false otherwise