Table of Contents

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

modifiers Modifiers
main Key

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

text string
menu IMenu

Command(string, Shortcut)

public Command(string text, Shortcut shortcut)

Parameters

text string
shortcut Shortcut

Command(string, Shortcut, Action)

public Command(string text, Shortcut shortcut, Action execute)

Parameters

text string
shortcut Shortcut
execute Action

Command(string, Action)

public Command(string text, Action execute)

Parameters

text string
execute Action

Fields

Copy

public static readonly ICommand Copy

Field Value

ICommand

Cut

public static readonly ICommand Cut

Field Value

ICommand

Delete

public static readonly ICommand Delete

Field Value

ICommand

Editing

public static readonly List<ICommand> Editing

Field Value

List<ICommand>

MenuSeparator

public static readonly ICommand MenuSeparator

Field Value

ICommand

Paste

public static readonly ICommand Paste

Field Value

ICommand

Redo

public static readonly ICommand Redo

Field Value

ICommand

SelectAll

public static readonly ICommand SelectAll

Field Value

ICommand

Undo

public static readonly ICommand Undo

Field Value

ICommand

checked

protected bool @checked

Field Value

bool

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

bool

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

bool

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

bool

Icon

Gets or sets the icon. The icon is used as the tool button icon.

public Icon Icon { get; set; }

Property Value

Icon

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

IMenu

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

bool

Shortcut

Gets or sets the command's primary shortcut key.

public Shortcut Shortcut { get; set; }

Property Value

Shortcut

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

string

TooltipText

Tooltip.

public string TooltipText { get; set; }

Property Value

string

UserData

Any data you need to pass to consumer of the command.

public object UserData { get; set; }

Property Value

object

Version

Gets the command's version, which is increased after changing any command's property.

public int Version { get; protected set; }

Property Value

int

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

bool

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

bool

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

commands List<ICommand>

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

bool

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

bool

Events

Issued

Occurs when command is issued by clicking on menu item, activating menu shortcut or clicking a tool button.

public event Action Issued

Event Type

Action