In This Article

BarModeCollection Class

Encapsulates a collection of modes.

[TypeConverter(typeof(BarModeCollectionConverter))]
public class BarModeCollection : SimpleCollection<string>
Inheritance:
object Collection<string> SimpleCollection<string> object

Remarks

This class is a zero-based indexed collection.

Constructors

BarModeCollection()

Initializes an instance of the class.

public BarModeCollection()

Methods

Contains(string?)

Determines whether the ICollection<T> contains a specific value.

public bool Contains(string? mode)
Parameter Type Description
mode string

Returns

bool:

true if item is found in the ICollection<T>; otherwise, false.

OnItemAdded(int, string)

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

protected override void OnItemAdded(int index, string value)
Parameter Type Description
index int

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

value string

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.

OnValidate(string, int)

Performs additional custom processes when validating a value.

protected override void OnValidate(string value, int existingIndex)
Parameter Type Description
value string

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.

Inherited Members

Extension Methods