In This Article

BarKeyboardShortcut Class

Represents a keyboard shortcut.

[TypeConverter(typeof(BarKeyboardShortcutConverter))]
public class BarKeyboardShortcut
Inheritance:
object object

Constructors

BarKeyboardShortcut(string?, int, int, bool)

Initializes an instance of the class.

public BarKeyboardShortcut(string? mode, int chordKey, int key, bool enabled = true)
Parameter Type Description
mode string

The mode in which the shortcut is valid. This value may be null if for the Global mode.

chordKey int

The Keys that starts a chord. This value may be null.

key int

The Keys specifying the main shortcut key.

enabled bool

Whether the shortcut is enabled.

BarKeyboardShortcut(string?, Keys, Keys, bool)

Represents a keyboard shortcut.

public BarKeyboardShortcut(string? mode, Keys chordKey, Keys key, bool enabled = true)
Parameter Type Description
mode string

The mode in which the shortcut is valid. This value may be null if for the Global mode.

chordKey Keys

The Keys that starts a chord. This value may be Keys.None.

key Keys

The Keys specifying the main shortcut key.

enabled bool

Whether the shortcut is enabled.

Properties

ChordKey

The Keys that starts the chord.

public Keys ChordKey { get; }

Property Value

Keys

Remarks

This value may be Keys.None.

Description

The user-friendly description of the shortcut (keys and mode).

public string Description { get; }

Property Value

string

Enabled

Indicates whether the shortcut is enabled.

public bool Enabled { get; set; }

Property Value

bool:

true if the shortcut is enabled; otherwise, false.

Remarks

Disable shortcuts that should display but not execute when pressed, such as for the Del key on an Edit.Delete command.

Key

The Keys that is the main shortcut key.

public Keys Key { get; }

Property Value

Keys

Mode

The mode in which the shortcut is valid.

public string? Mode { get; }

Property Value

string

Remarks

This value may be null if for the Global mode.

Methods

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)
Parameter Type Description
obj object

The object to compare with the current object.

Returns

bool:

true if the specified object is equal to the current object; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int:

A hash code for the current object.

GetKeyString(Keys)

Returns the string version of a Keys.

public static string GetKeyString(Keys key)
Parameter Type Description
key Keys

The Keys to examine.

Returns

string

ToString()

Returns the string representation of this object.

public override string? ToString()

Returns

string:

The string representation of this object.

Inherited Members

Extension Methods