Search Results for

    Show / Hide Table of Contents

    Class TimedObjectsCollection<TObject>

    Represents a basic collection of the ITimedObject.
    Inheritance
    object
    TimedObjectsCollection<TObject>
    Implements
    ICollection<TObject>
    IEnumerable<TObject>
    IEnumerable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Melanchall.DryWetMidi.Interaction
    Assembly: Melanchall.DryWetMidi.dll
    Syntax
    public sealed class TimedObjectsCollection<TObject> : ICollection<TObject>, IEnumerable<TObject>, IEnumerable where TObject : ITimedObject
    Type Parameters
    Name Description
    TObject The type of elements in the collection.

    Properties

    Count

    Gets the number of objects contained in the TimedObjectsCollection<TObject>.
    Declaration
    public int Count { get; }
    Property Value
    Type Description
    int

    IsReadOnly

    Gets a value indicating whether the TimedObjectsCollection<TObject> is read-only.
    Declaration
    public bool IsReadOnly { get; }
    Property Value
    Type Description
    bool

    Methods

    Add(IEnumerable<TObject>)

    Adds objects to this collection.
    Declaration
    public void Add(IEnumerable<TObject> objects)
    Parameters
    Type Name Description
    IEnumerable<TObject> objects Objects to add to the collection.
    Exceptions
    Type Condition
    ArgumentNullException objects is null.

    Add(TObject)

    Adds an object to this collection.
    Declaration
    public void Add(TObject obj)
    Parameters
    Type Name Description
    TObject obj Object to add to the collection.
    Exceptions
    Type Condition
    ArgumentNullException obj is null.

    Add(params TObject[])

    Adds objects to this collection.
    Declaration
    public void Add(params TObject[] objects)
    Parameters
    Type Name Description
    TObject[] objects Objects to add to the collection.
    Exceptions
    Type Condition
    ArgumentNullException objects is null.

    Clear()

    Removes all objects from this collection.
    Declaration
    public void Clear()

    Contains(TObject)

    Determines whether the TimedObjectsCollection<TObject> contains a specific object.
    Declaration
    public bool Contains(TObject obj)
    Parameters
    Type Name Description
    TObject obj The object to locate in the TimedObjectsCollection<TObject>.
    Returns
    Type Description
    bool true if the object is found; otherwise, false.

    CopyTo(TObject[], int)

    Copies the objects of the TimedObjectsCollection<TObject> to an array, starting at a particular index.
    Declaration
    public void CopyTo(TObject[] array, int arrayIndex)
    Parameters
    Type Name Description
    TObject[] array The one-dimensional array that is the destination of the objects copied from TimedObjectsCollection<TObject>. The array must have zero-based indexing.
    int arrayIndex The zero-based index in array at which copying begins.
    Exceptions
    Type Condition
    ArgumentNullException array is null.
    ArgumentOutOfRangeException One of the following errors occurred:
    • arrayIndex is less than zero or greater than the length of the array.
    • The number of elements in the TimedObjectsCollection<TObject> is greater than the available space from the arrayIndex to the end of the array.

    GetEnumerator()

    Returns an enumerator that iterates through the collection.
    Declaration
    public IEnumerator<TObject> GetEnumerator()
    Returns
    Type Description
    IEnumerator<TObject> An enumerator that can be used to iterate through the collection.

    Remove(IEnumerable<TObject>)

    Removes objects from this collection.
    Declaration
    public bool Remove(IEnumerable<TObject> objects)
    Parameters
    Type Name Description
    IEnumerable<TObject> objects Objects to remove from the collection.
    Returns
    Type Description
    bool true if objects were successfully removed from the collection; otherwise, false.
    Exceptions
    Type Condition
    ArgumentNullException objects is null.

    Remove(TObject)

    Removes the first occurrence of a specific object from this collection
    Declaration
    public bool Remove(TObject obj)
    Parameters
    Type Name Description
    TObject obj Object to remove from the collection.
    Returns
    Type Description
    bool true if the object was successfully removed; otherwise, false.
    Exceptions
    Type Condition
    ArgumentNullException obj is null.

    Remove(params TObject[])

    Removes objects from this collection.
    Declaration
    public bool Remove(params TObject[] objects)
    Parameters
    Type Name Description
    TObject[] objects Objects to remove from the collection.
    Returns
    Type Description
    bool true if objects were successfully removed from the collection; otherwise, false.
    Exceptions
    Type Condition
    ArgumentNullException objects is null.

    RemoveAll(Predicate<TObject>)

    Removes all the objects that match the conditions defined by the specified predicate.
    Declaration
    public void RemoveAll(Predicate<TObject> match)
    Parameters
    Type Name Description
    Predicate<TObject> match The Predicate<T> delegate that defines the conditions of the objects to remove.
    Exceptions
    Type Condition
    ArgumentNullException match is null.

    Events

    CollectionChanged

    Occurs when objects collection changes (an object added or removed).
    Declaration
    public event TimedObjectsCollectionChangedEventHandler<TObject> CollectionChanged
    Event Type
    Type Description
    TimedObjectsCollectionChangedEventHandler<TObject>

    Implements

    ICollection<T>
    IEnumerable<T>
    IEnumerable

    Extension Methods

    TimedObjectUtilities.AtTime<TObject>(IEnumerable<TObject>, ITimeSpan, TempoMap)
    TimedObjectUtilities.AtTime<TObject>(IEnumerable<TObject>, long)
    In this article
    Back to top 2025 / Generated by DocFX