In This Article

BarKeyboardShortcutCollection Class

Encapsulates a collection of BarKeyboardShortcut objects.

[TypeConverter(typeof(BarKeyboardShortcutCollectionConverter))]
public class BarKeyboardShortcutCollection
Inheritance:
object object

Remarks

This class is a zero-based indexed collection.

Properties

Count

Gets the number of elements contained in the BarKeyboardShortcutCollection instance.

public virtual int Count { get; }

Property Value

int:

The number of elements contained in the BarKeyboardShortcutCollection instance.

See Also

InnerList

Gets the list of items contained in the collection instance.

protected ArrayList InnerList { get; }

Property Value

ArrayList:

An ArrayList representing the collection instance itself.

See Also

IsFixedSize

Gets a value indicating whether the collection has a fixed size.

public virtual bool IsFixedSize { get; }

Property Value

bool:

true if the collection has a fixed size; otherwise, false.

Remarks

A collection with a fixed size does not allow the addition or removal of elements, but it allows the modification of existing elements.

See Also

IsReadOnly

Gets a value indicating whether the collection is read-only.

public virtual bool IsReadOnly { get; }

Property Value

bool:

true if the collection is read-only; otherwise, false.

See Also

IsSynchronized

Gets a value indicating whether access to the collection is synchronized (thread-safe).

public virtual bool IsSynchronized { get; }

Property Value

bool:

true if the collection is synchronized (thread-safe); otherwise, false.

Remarks

To guarantee the thread safety of the collection, all operations must be done through the wrapper returned by the SyncRoot property.

See Also

this[int]

Gets or sets the BarKeyboardShortcut at the specified index.

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

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

The index of the BarKeyboardShortcut to return.

Property Value

BarKeyboardShortcut:

The BarKeyboardShortcut at the specified index.

See Also

SyncRoot

Gets an Object that can be used to synchronize access to the collection.

public virtual object SyncRoot { get; }

Property Value

object:

An Object that can be used to synchronize access to the collection.

See Also

Methods

Add(BarKeyboardShortcut)

Adds a BarKeyboardShortcut to the end of the collection.

public int Add(BarKeyboardShortcut value)
Parameter Type Description
value BarKeyboardShortcut

The BarKeyboardShortcut to be added to the end of the collection.

Returns

int:

The collection index at which the BarKeyboardShortcut has been added.

See Also

AddRange(BarKeyboardShortcut[])

Adds multiple BarKeyboardShortcut objects to the collection.

public void AddRange(BarKeyboardShortcut[] items)
Parameter Type Description
items BarKeyboardShortcut[]

The array of BarKeyboardShortcut objects to add.

See Also

Clear()

Removes all BarKeyboardShortcut objects from the collection.

public void Clear()

See Also

Contains(BarKeyboardShortcut)

Returns whether the specified BarKeyboardShortcut is in the collection.

public virtual bool Contains(BarKeyboardShortcut value)
Parameter Type Description
value BarKeyboardShortcut

The BarKeyboardShortcut to locate in the collection.

Returns

bool:

true if the BarKeyboardShortcut is found in the collection; otherwise, false.

See Also

CopyTo(Array, int)

Copies the entire collection to a compatible one-dimensional Array, starting at the specified index of the target array.

public virtual void CopyTo(Array array, int arrayIndex)
Parameter Type Description
array Array

The one-dimensional Array that is the destination of the elements copied from the collection. The Array must have zero-based indexing.

arrayIndex int

The zero-based index in array at which copying begins.

See Also

GetApplicableKeyboardShortcutText(BarManager)

Returns the applicable keyboard shortcut text by examining the current mode of the BarManager in use.

public string GetApplicableKeyboardShortcutText(BarManager barManager)
Parameter Type Description
barManager BarManager

The BarManager to examine.

Returns

string:

The applicable keyboard shortcut text by examining the current mode of the BarManager in use.

See Also

GetEnumerator()

Retrieves an IEnumerator object for the entire collection.

public virtual IEnumerator GetEnumerator()

Returns

IEnumerator:

An IEnumerator object for the entire collection

Remarks

Enumerators are intended to be used only to read data in the collection. Enumerators cannot be used to modify the underlying collection.

The enumerator does not have exclusive access to the collection.

When an enumerator is instantiated, it takes a snapshot of the current state of the collection. If changes are made to the collection, such as adding, modifying or deleting elements, the snapshot gets out of sync and the enumerator throws an InvalidOperationException. Two enumerators instantiated from the same collection at the same time can have different snapshots of the collection.

See Also

IndexOf(BarKeyboardShortcut)

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

public virtual int IndexOf(BarKeyboardShortcut value)
Parameter Type Description
value BarKeyboardShortcut

The BarKeyboardShortcut to locate in the collection.

Returns

int:

The zero-based index of the first occurrence of the BarKeyboardShortcut within the entire collection, if found; otherwise, -1.

See Also

IndexOf(BarKeyboardShortcut, int)

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

public virtual int IndexOf(BarKeyboardShortcut value, int startIndex)
Parameter Type Description
value BarKeyboardShortcut

The BarKeyboardShortcut to locate in the collection.

startIndex int

The start index to search.

Returns

int:

The zero-based index of the first occurrence of the BarKeyboardShortcut within the entire collection, if found; otherwise, -1.

See Also

Insert(int, BarKeyboardShortcut)

Inserts a BarKeyboardShortcut into the collection at the specified index.

public void Insert(int index, BarKeyboardShortcut value)
Parameter Type Description
index int

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

value BarKeyboardShortcut

The BarKeyboardShortcutto insert.

See Also

OnObjectAdded(int, BarKeyboardShortcut)

Performs additional custom processes after an object is added to the collection.

protected virtual void OnObjectAdded(int index, BarKeyboardShortcut value)
Parameter Type Description
index int

The zero-based index at which the object was inserted.

value BarKeyboardShortcut

The object that was inserted.

Remarks

The default implementation of this method is intended to be overridden by a derived class to perform some action after the specified object is added.

See Also

OnObjectAdding(int, BarKeyboardShortcut)

Performs additional custom processes before an object is added to the collection.

protected virtual void OnObjectAdding(int index, BarKeyboardShortcut value)
Parameter Type Description
index int

The zero-based index at which the object was inserted.

value BarKeyboardShortcut

The object that was inserted.

Remarks

The default implementation of this method is intended to be overridden by a derived class to perform some action after the specified object is added.

See Also

OnObjectRemoved(int, BarKeyboardShortcut)

Performs additional custom processes after an object is removed from the collection.

protected virtual void OnObjectRemoved(int index, BarKeyboardShortcut value)
Parameter Type Description
index int

The zero-based index from which the object was removed.

value BarKeyboardShortcut

The object that was removed.

Remarks

The default implementation of this method is intended to be overridden by a derived class to perform some action after the specified object is removed.

See Also

OnObjectRemoving(int, BarKeyboardShortcut)

Performs additional custom processes before an object is removed from the collection.

protected virtual void OnObjectRemoving(int index, BarKeyboardShortcut value)
Parameter Type Description
index int

The zero-based index from which the object was removed.

value BarKeyboardShortcut

The object that was removed.

Remarks

The default implementation of this method is intended to be overridden by a derived class to perform some action before the specified object is removed.

See Also

OnValidate(BarKeyboardShortcut, int)

Performs additional custom processes when validating a value.

protected virtual void OnValidate(BarKeyboardShortcut value, int existingIndex)
Parameter Type Description
value BarKeyboardShortcut

The object to validate.

existingIndex int

The index within the collection of the object that would be replaced by the value.

Remarks

The default implementation of this method determines whether value is null, and if so, throws ArgumentNullException. It is intended to be overridden by a derived class to perform additional action when the specified element is validated.

See Also

Remove(BarKeyboardShortcut)

Removes the first occurrence of a specific BarKeyboardShortcut from the collection.

public void Remove(BarKeyboardShortcut value)
Parameter Type Description
value BarKeyboardShortcut

The BarKeyboardShortcut to remove from the collection.

Remarks

The elements that follow the removed element move up to occupy the vacated spot. The indexes of the elements that are moved are also updated.

See Also

RemoveAt(int)

Removes the BarKeyboardShortcut at the specified index of the collection.

public void RemoveAt(int index)
Parameter Type Description
index int

The zero-based index of the BarKeyboardShortcut to remove.

Remarks

The elements that follow the removed element move up to occupy the vacated spot. The indexes of the elements that are moved are also updated.

See Also

ToArray()

Copies the items of the collection to a new BarKeyboardShortcut array.

public BarKeyboardShortcut[] ToArray()

Returns

BarKeyboardShortcut[]:

An array of BarKeyboardShortcut items.

See Also

Inherited Members

See Also