Interface ICommand
- Namespace
- Lime
- Assembly
- Lime.dll
The ICommand interface provides an abstract user interface command.
public interface ICommand
Properties
Checked
Gets or sets a value indicating whether the menu item or tool button is checked.
bool Checked { get; set; }
Property Value
ClearUserDataAfterUse
Gets or sets a value indicating whether a custom command's UserData should be cleaned after use.
bool ClearUserDataAfterUse { get; set; }
Property Value
Enabled
Gets or sets a value indicating whether the command is enabled (e.g. in menus and toolbars).
bool Enabled { get; set; }
Property Value
Icon
Gets or sets the icon. The icon is used as the tool button icon.
Icon Icon { get; set; }
Property Value
Menu
Gets or sets the menu contained by this command. Commands that contain menus can be used to create menu items with submenus, or inserted into toolbars to create buttons with popup menus.
IMenu Menu { get; set; }
Property Value
Repeatable
Gets or sets a value indicating whether the command will auto repeat when the keyboard shortcut combination is held down. Commands used in the main menu are always repeatable. The default value is true.
bool Repeatable { get; set; }
Property Value
Shortcut
Gets or sets the command's primary shortcut key.
Shortcut Shortcut { get; set; }
Property Value
Text
Gets or sets the command's descriptive text. If the command is added to a menu, the menu option will consist of the text and the shortcut (if there is one).
string Text { get; set; }
Property Value
TooltipText
Tooltip.
string TooltipText { get; set; }
Property Value
UserData
Any data you need to pass to consumer of the command.
object UserData { get; set; }
Property Value
Version
Gets the command's version, which is increased after changing any command's property.
int Version { get; }
Property Value
Visible
Gets or sets a value indicating whether the command can be seen (e.g. in menus and toolbars).
bool Visible { get; set; }
Property Value
Methods
Consume()
Consumes the command. WasIssued is false if the command was consumed. Returns true is command was issued before consuming.
bool Consume()
Returns
IsConsumed()
Gets a value indicating whether the command has been consumed. The command should not be consumed before changing its Enabled property.
bool IsConsumed()
Returns
WasIssued()
Returns true, if the command was issued, enabled and has not been consumed yet.
bool WasIssued()
Returns
Events
Issued
Occurs when command is issued by clicking on menu item, activating menu shortcut or clicking a tool button.
event Action Issued