In This Article

CommandLinkCollection Class

Encapsulates a collection of CommandLink items.

public class CommandLinkCollection : CollectionBase
Inheritance:
object CollectionBase object

Remarks

This class is a zero-based indexed collection.

Constructors

CommandLinkCollection()

Initializes a new instance of the CommandLinkCollection class.

public CommandLinkCollection()

Remarks

The default constructor initializes all fields to their default values.

See Also

Properties

this[int]

Gets the CommandLink at the specified index.

[C#] In C#, this property is the indexer for the CommandLinkCollection class.

public CommandLink this[int index] { get; }
Parameter Type Description
index int

The index of the CommandLink to return.

Property Value

CommandLink:

The CommandLink at the specified index.

See Also

Methods

Adds the specified CommandLink to the collection.

public int Add(CommandLink commandLink)
Parameter Type Description
commandLink CommandLink

The CommandLink to add to the collection.

Returns

int:

The position into which the new item was inserted.

See Also

Adds an array of CommandLink objects to the collection.

public void AddRange(CommandLink[] commandLinks)
Parameter Type Description
commandLinks CommandLink[]

The array of CommandLink objects to add to the collection.

See Also

Returns whether the collection contains the specified CommandLink.

public bool Contains(CommandLink commandLink)
Parameter Type Description
commandLink CommandLink

The CommandLink to look for in the collection.

Returns

bool:

true if the collection contains the specified CommandLink; otherwise, false.

See Also

FilterModifierKeys(Keys)

Filters out the CTRL, SHIFT, and ALT modifier keys from a Keys specification.

public static Keys FilterModifierKeys(Keys keyCode)
Parameter Type Description
keyCode Keys

The Keys to filter.

Returns

Keys:

The filtered Keys.

See Also

Returns an array of the applicable CommandLink objects for the specified criteria.

public CommandLink[] GetApplicableCommandLinks(Keys keyCode)
Parameter Type Description
keyCode Keys

The keyboard code of the key that is pressed.

Returns

CommandLink[]:

An array of the applicable CommandLink objects for the specified criteria.

See Also

GetCurrentModifierKeys()

Returns the currently-pressed modifier keys.

public static ModifierKeys GetCurrentModifierKeys()

Returns

ModifierKeys:

A ModifierKeys containing the currently-pressed modifier keys.

See Also

GetModifierKeys(Keys)

Returns the modifier keys.

public static ModifierKeys GetModifierKeys(Keys keyCode)
Parameter Type Description
keyCode Keys

The keyboard code of the key that is pressed.

Returns

ModifierKeys:

A ModifierKeys containing the modifier keys.

See Also

IndexOf(Command)

Searches for a CommandLink for the specified Command and returns the zero-based index of the first occurrence within the entire collection.

public virtual int IndexOf(Command command)
Parameter Type Description
command Command

The Command to locate in the collection.

Returns

int:

The zero-based index of the first occurrence of a CommandLink for the specified Command within the entire collection, if found; otherwise, -1.

See Also

Returns the index of the specified CommandLink in the collection.

public int IndexOf(CommandLink commandLink)
Parameter Type Description
commandLink CommandLink

The CommandLink to look for.

Returns

int:

If found, the index where the CommandLink is in the collection; otherwise, -1.

See Also

Inserts a CommandLink into the collection at the specified index.

public void Insert(int index, CommandLink commandLink)
Parameter Type Description
index int

The zero-based index at which the CommandLink should be inserted.

commandLink CommandLink

The CommandLink to insert into the collection.

See Also

Removes the specified CommandLink from the collection.

public void Remove(CommandLink commandLink)
Parameter Type Description
commandLink CommandLink

The CommandLink to remove from the collection.

See Also

Inherited Members

See Also