In This Article

CommandLinkCollection Class

Encapsulates a collection of CommandLink items.

public class CommandLinkCollection : CollectionBase, IList, ICollection, IEnumerable
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.

Properties

Item[Int32]

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 Int32

The index of the CommandLink to return.

Property Value

CommandLink:

The CommandLink at the specified index.

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

Int32:

The position into which the new item was inserted.

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.

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

Boolean:

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

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.

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.

GetCurrentModifierKeys()

Returns the currently-pressed modifier keys.

public static ModifierKeys GetCurrentModifierKeys()

Returns

ModifierKeys:

A ModifierKeys containing the currently-pressed modifier keys.

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.

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

Int32:

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

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

Int32:

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

Inserts a CommandLink into the collection at the specified index.

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

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

commandLink CommandLink

The CommandLink to insert into the collection.

Removes the specified CommandLink from the collection.

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

The CommandLink to remove from the collection.

Inherited Members

See Also