Class EventsCollection
Inheritance
EventsCollection
Assembly: Melanchall.DryWetMidi.dll
Syntax
public sealed class EventsCollection : ICollection<MidiEvent>, IEnumerable<MidiEvent>, IEnumerable
Properties
Count
Gets the number of events contained in the collection.
Declaration
public int Count { get; }
Property Value
IsReadOnly
Declaration
public bool IsReadOnly { get; }
Property Value
this[int]
Gets or sets the event at the specified index.
Declaration
public MidiEvent this[int index] { get; set; }
Parameters
Type |
Name |
Description |
int |
index |
The zero-based index of the event to get or set. |
Property Value
Type |
Description |
MidiEvent |
The event at the specified index. |
Exceptions
Methods
Add(MidiEvent)
Adds an event to the end of collection.
Declaration
public void Add(MidiEvent midiEvent)
Parameters
Type |
Name |
Description |
MidiEvent |
midiEvent |
The event to be added to the end of the collection. |
Exceptions
AddRange(IEnumerable<MidiEvent>)
Adds events to the end of collection.
Declaration
public void AddRange(IEnumerable<MidiEvent> events)
Parameters
Type |
Name |
Description |
IEnumerable<MidiEvent> |
events |
Events to be added to the end of the collection. |
Exceptions
Clear()
Declaration
Contains(MidiEvent)
Declaration
public bool Contains(MidiEvent item)
Parameters
Returns
CopyTo(MidiEvent[], int)
Declaration
public void CopyTo(MidiEvent[] array, int arrayIndex)
Parameters
Type |
Name |
Description |
MidiEvent[] |
array |
The one-dimensional Array that is the destination of
the elements copied from EventsCollection. The array must have zero-based
indexing. |
int |
arrayIndex |
The zero-based index in array at which copying begins. |
Exceptions
GetEnumerator()
Declaration
public IEnumerator<MidiEvent> GetEnumerator()
Returns
IndexOf(MidiEvent)
Searches for the specified event and returns the zero-based index of the first
occurrence within the entire
EventsCollection.
Declaration
public int IndexOf(MidiEvent midiEvent)
Parameters
Returns
Type |
Description |
int |
The zero-based index of the first occurrence of event within the entire
EventsCollection, if found; otherwise, –1. |
Exceptions
Insert(int, MidiEvent)
Inserts an event into the collection at the specified index.
Declaration
public void Insert(int index, MidiEvent midiEvent)
Parameters
Type |
Name |
Description |
int |
index |
The zero-based index at which the event should be inserted. |
MidiEvent |
midiEvent |
The event to insert. |
Exceptions
InsertRange(int, IEnumerable<MidiEvent>)
Inserts a set of events into the collection at the specified index.
Declaration
public void InsertRange(int index, IEnumerable<MidiEvent> midiEvents)
Parameters
Type |
Name |
Description |
int |
index |
The zero-based index at which the events should be inserted. |
IEnumerable<MidiEvent> |
midiEvents |
The events to insert. |
Exceptions
Remove(MidiEvent)
Removes the first occurrence of a specific event from the collection.
Declaration
public bool Remove(MidiEvent midiEvent)
Parameters
Type |
Name |
Description |
MidiEvent |
midiEvent |
The event to remove from the collection. The value cannot be null . |
Returns
Type |
Description |
bool |
true if event is successfully removed; otherwise, false . This method also returns
false if event was not found in the collection. |
Exceptions
RemoveAll(Predicate<MidiEvent>)
Removes all the events that match the conditions defined by the specified predicate.
Declaration
public int RemoveAll(Predicate<MidiEvent> match)
Parameters
Returns
Exceptions
RemoveAt(int)
Removes the event at the specified index of the collection.
Declaration
public void RemoveAt(int index)
Parameters
Type |
Name |
Description |
int |
index |
The zero-based index of the event to remove. |
Exceptions
Implements
Extension Methods