Class Command
- Namespace
- Lime
- Assembly
- Lime.dll
public class Command : ICommand
- Inheritance
-
Command
- Implements
- Inherited Members
Constructors
Command()
public Command()
Command(Key)
public Command(Key main)
Parameters
main
Key
Command(Modifiers, Key)
public Command(Modifiers modifiers, Key main)
Parameters
Command(Shortcut)
public Command(Shortcut shortcut)
Parameters
shortcut
Shortcut
Command(string)
public Command(string text)
Parameters
text
string
Command(string, IMenu)
public Command(string text, IMenu menu)
Parameters
Command(string, Shortcut)
public Command(string text, Shortcut shortcut)
Parameters
Command(string, Shortcut, Action)
public Command(string text, Shortcut shortcut, Action execute)
Parameters
Command(string, Action)
public Command(string text, Action execute)
Parameters
Fields
Copy
public static readonly ICommand Copy
Field Value
Cut
public static readonly ICommand Cut
Field Value
Delete
public static readonly ICommand Delete
Field Value
Editing
public static readonly List<ICommand> Editing
Field Value
MenuSeparator
public static readonly ICommand MenuSeparator
Field Value
Paste
public static readonly ICommand Paste
Field Value
Redo
public static readonly ICommand Redo
Field Value
SelectAll
public static readonly ICommand SelectAll
Field Value
Undo
public static readonly ICommand Undo
Field Value
checked
protected bool @checked
Field Value
Properties
Checked
Gets or sets a value indicating whether the menu item or tool button is checked.
public virtual bool Checked { get; set; }
Property Value
ClearUserDataAfterUse
Gets or sets a value indicating whether a custom command's UserData should be cleaned after use.
public bool ClearUserDataAfterUse { get; set; }
Property Value
Enabled
Gets or sets a value indicating whether the command is enabled (e.g. in menus and toolbars).
public bool Enabled { get; set; }
Property Value
Icon
Gets or sets the icon. The icon is used as the tool button icon.
public 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.
public 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.
public bool Repeatable { get; set; }
Property Value
Shortcut
Gets or sets the command's primary shortcut key.
public 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).
public string Text { get; set; }
Property Value
TooltipText
Tooltip.
public string TooltipText { get; set; }
Property Value
UserData
Any data you need to pass to consumer of the command.
public object UserData { get; set; }
Property Value
Version
Gets the command's version, which is increased after changing any command's property.
public int Version { get; protected set; }
Property Value
Visible
Gets or sets a value indicating whether the command can be seen (e.g. in menus and toolbars).
public 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.
public bool Consume()
Returns
ConsumeRange(IEnumerable<ICommand>)
public static void ConsumeRange(IEnumerable<ICommand> commands)
Parameters
commands
IEnumerable<ICommand>
ConsumeRange(List<ICommand>)
public static void ConsumeRange(List<ICommand> commands)
Parameters
IsConsumed()
Gets a value indicating whether the command has been consumed. The command should not be consumed before changing its Enabled property.
public bool IsConsumed()
Returns
Issue()
public void Issue()
ResetConsumedCommands()
public static void ResetConsumedCommands()
WasIssued()
Returns true, if the command was issued, enabled and has not been consumed yet.
public bool WasIssued()
Returns
Events
Issued
Occurs when command is issued by clicking on menu item, activating menu shortcut or clicking a tool button.
public event Action Issued