Table of Contents

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

menuId string

Id 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

selectedMenu MenuWithHandler

Id of the menu command that was selected

selected bool

true, 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

menuId string

Id of the menu command to be processed

commandState CommandState

State object to modify if appropriate

Returns

bool

true, if handled, false otherwise