Table of Contents

Class LaneNoteCollection<TNote, TLane>

Namespace
ChartTools
Assembly
ChartTools.dll
public class LaneNoteCollection<TNote, TLane> : ICollection<TNote>, IReadOnlyList<TNote>, IReadOnlyCollection<TNote>, IEnumerable<TNote>, IEnumerable where TNote : LaneNote<TLane>, new() where TLane : struct, Enum

Type Parameters

TNote
TLane
Inheritance
LaneNoteCollection<TNote, TLane>
Implements
Inherited Members
Extension Methods

Constructors

LaneNoteCollection(bool)

public LaneNoteCollection(bool openExclusivity)

Parameters

openExclusivity bool

Properties

Count

Gets the number of elements contained in the ICollection<T>.

public int Count { get; }

Property Value

int

The number of elements contained in the ICollection<T>.

this[int]

Gets the note at a given index based on order or addition.

public TNote this[int index] { get; }

Parameters

index int

Index of the note in the collection, not to be confused with Index.

Property Value

TNote

Note at the index

Exceptions

ArgumentOutOfRangeException

this[TLane]

Gets the note matching a given lane.

public TNote? this[TLane lane] { get; }

Parameters

lane TLane

Lane of the note

Property Value

TNote

Note with the lane if present, otherwise null.

OpenExclusivity

If true, trying to combine an open note with other notes will remove the current ones.

public bool OpenExclusivity { get; }

Property Value

bool

Methods

Add(TNote)

public void Add(TNote note)

Parameters

note TNote

Note to add

Remarks

Adding a note that already exists will overwrite the existing note.

If OpenExclusivity is true, combining an open note with other notes will remove the current ones.

Add(TLane)

public void Add(TLane lane)

Parameters

lane TLane

Clear()

Removes all items from the ICollection<T>.

public void Clear()

Exceptions

NotSupportedException

The ICollection<T> is read-only.

Contains(byte)

Determines if any note matches a given index.

public bool Contains(byte index)

Parameters

index byte

Returns

bool

Contains(TNote)

Determines if any note matches the lane of a given note.

public bool Contains(TNote note)

Parameters

note TNote

Returns

bool

Exceptions

ArgumentNullException

Contains(TLane)

Determines if any note matches a given lane.

public bool Contains(TLane lane)

Parameters

lane TLane

Returns

bool

CopyTo(TNote[], int)

Copies the elements of the ICollection<T> to an Array, starting at a particular Array index.

public void CopyTo(TNote[] array, int arrayIndex)

Parameters

array TNote[]

The one-dimensional Array that is the destination of the elements copied from ICollection<T>. The Array must have zero-based indexing.

arrayIndex int

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

Exceptions

ArgumentNullException

array is null.

ArgumentOutOfRangeException

arrayIndex is less than 0.

ArgumentException

The number of elements in the source ICollection<T> is greater than the available space from arrayIndex to the end of the destination array.

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<TNote> GetEnumerator()

Returns

IEnumerator<TNote>

An enumerator that can be used to iterate through the collection.

Remove(byte)

Removes the note that matches a given index.

public bool Remove(byte index)

Parameters

index byte

Returns

bool

true if a matching note was found.

Remove(TNote)

Removes the note that matches the lane of a given note.

public bool Remove(TNote note)

Parameters

note TNote

Returns

bool

true if a matching note was found.

Remove(TLane)

Removes the note that matches a given lane.

public bool Remove(TLane lane)

Parameters

lane TLane

Returns

bool

true if a matching note was found.