Search Results for

    Show / Hide Table of Contents

    Class ObservableTimedObjectsCollection

    Provides a collection which can be observed for changes via CollectionChanged event.
    Inheritance
    object
    ObservableTimedObjectsCollection
    Implements
    IObservableTimedObjectsCollection
    IEnumerable<ITimedObject>
    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 ObservableTimedObjectsCollection : IObservableTimedObjectsCollection, IEnumerable<ITimedObject>, IEnumerable

    Constructors

    ObservableTimedObjectsCollection()

    Initializes an empty instance of the ObservableTimedObjectsCollection.
    Declaration
    public ObservableTimedObjectsCollection()

    ObservableTimedObjectsCollection(IEnumerable<ITimedObject>)

    Initializes a new instance of the ObservableTimedObjectsCollection with the specified objects.
    Declaration
    public ObservableTimedObjectsCollection(IEnumerable<ITimedObject> timedObjects)
    Parameters
    Type Name Description
    IEnumerable<ITimedObject> timedObjects Objects to add to the collection.

    Properties

    Count

    Gets the number of objects currently contained in the collection.
    Declaration
    public int Count { get; }
    Property Value
    Type Description
    int

    Methods

    Add(params ITimedObject[])

    Adds the specified objects to the current collection.
    Declaration
    public void Add(params ITimedObject[] objects)
    Parameters
    Type Name Description
    ITimedObject[] objects Objects to add to the collection.
    Remarks
    If the method is executed within the ChangeCollection(Action), the CollectionChanged event will be fired when you're done with the ChangeCollection(Action) method.
    Exceptions
    Type Condition
    ArgumentNullException objects is null.

    Add(IEnumerable<ITimedObject>)

    Adds the specified objects to the current collection.
    Declaration
    public void Add(IEnumerable<ITimedObject> objects)
    Parameters
    Type Name Description
    IEnumerable<ITimedObject> objects Objects to add to the collection.
    Remarks
    If the method is executed within the ChangeCollection(Action), the CollectionChanged event will be fired when you're done with the ChangeCollection(Action) method.
    Exceptions
    Type Condition
    ArgumentNullException objects is null.

    ChangeCollection(Action)

    Executes a specified action that modifies the collection.
    Declaration
    public void ChangeCollection(Action change)
    Parameters
    Type Name Description
    Action change An Action that performs the modifications to the collection.
    Remarks
    If the collection is already undergoing a batch operation, the CollectionChanged event will not be raised until the outermost operation completes. This ensures that multiple changes can be grouped together and processed as a single batch.
    Exceptions
    Type Condition
    ArgumentNullException change is null.

    ChangeObject(ITimedObject, Action<ITimedObject>)

    Executes an action that modifies the specified object.
    Declaration
    public void ChangeObject(ITimedObject timedObject, Action<ITimedObject> change)
    Parameters
    Type Name Description
    ITimedObject timedObject The object to be modified.
    Action<ITimedObject> change An Action that performs the modifications to the timedObject.
    Remarks
    If the method is executed within the ChangeCollection(Action), the CollectionChanged event will be fired when you're done with the ChangeCollection(Action) method.
    Exceptions
    Type Condition
    ArgumentNullException One of the following errors occurred:
    • timedObject is null.
    • change is null.

    Clear()

    Removes all objects from the current collection.
    Declaration
    public void Clear()
    Remarks
    If the method is executed within the ChangeCollection(Action), the CollectionChanged event will be fired when you're done with the ChangeCollection(Action) method.

    GetEnumerator()

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

    Remove(params ITimedObject[])

    Removes the specified objects from the current collection.
    Declaration
    public bool Remove(params ITimedObject[] objects)
    Parameters
    Type Name Description
    ITimedObject[] objects Objects to remove from the collection.
    Returns
    Type Description
    bool
    Remarks
    If the method is executed within the ChangeCollection(Action), the CollectionChanged event will be fired when you're done with the ChangeCollection(Action) method.
    Exceptions
    Type Condition
    ArgumentNullException objects is null.

    Remove(IEnumerable<ITimedObject>)

    Removes the specified objects from the current collection.
    Declaration
    public bool Remove(IEnumerable<ITimedObject> objects)
    Parameters
    Type Name Description
    IEnumerable<ITimedObject> objects Objects to remove from the collection.
    Returns
    Type Description
    bool
    Remarks
    If the method is executed within the ChangeCollection(Action), the CollectionChanged event will be fired when you're done with the ChangeCollection(Action) method.
    Exceptions
    Type Condition
    ArgumentNullException objects is null.

    Events

    CollectionChanged

    Occurs when collection changed (objects have been added, removed or changed).
    Declaration
    public event EventHandler<ObservableTimedObjectsCollectionChangedEventArgs> CollectionChanged
    Event Type
    Type Description
    EventHandler<ObservableTimedObjectsCollectionChangedEventArgs>

    Implements

    IObservableTimedObjectsCollection
    IEnumerable<T>
    IEnumerable

    Extension Methods

    GetObjectsUtilities.GetObjects(IEnumerable<ITimedObject>, ObjectType, ObjectDetectionSettings)
    RestsUtilities.GetRests(IEnumerable<ITimedObject>, RestDetectionSettings)
    RestsUtilities.WithRests(IEnumerable<ITimedObject>, RestDetectionSettings)
    TimedObjectUtilities.AtTime<TObject>(IEnumerable<TObject>, ITimeSpan, TempoMap)
    TimedObjectUtilities.AtTime<TObject>(IEnumerable<TObject>, long)
    TimedObjectUtilities.ToFile(IEnumerable<ITimedObject>)
    TimedObjectUtilities.ToTrackChunk(IEnumerable<ITimedObject>)
    CsvSerializer.SerializeToCsv(IEnumerable<ITimedObject>, Stream, TempoMap, CsvSerializationSettings)
    CsvSerializer.SerializeToCsv(IEnumerable<ITimedObject>, string, bool, TempoMap, CsvSerializationSettings)
    Merger.MergeObjects(IEnumerable<ITimedObject>, TempoMap, ObjectsMergingSettings)
    RepeaterUtilities.Repeat(IEnumerable<ITimedObject>, int, TempoMap, RepeatingSettings)
    Resizer.ResizeObjectsGroup(IEnumerable<ITimedObject>, ITimeSpan, TempoMap, ObjectsGroupResizingSettings)
    Resizer.ResizeObjectsGroup(IEnumerable<ITimedObject>, double, TempoMap, ObjectsGroupResizingSettings)
    Splitter.SplitObjectsAtDistance(IEnumerable<ITimedObject>, ITimeSpan, LengthedObjectTarget, TempoMap, Predicate<ITimedObject>)
    Splitter.SplitObjectsAtDistance(IEnumerable<ITimedObject>, double, TimeSpanType, LengthedObjectTarget, TempoMap, Predicate<ITimedObject>)
    Splitter.SplitObjectsByGrid(IEnumerable<ITimedObject>, IGrid, TempoMap, Predicate<ITimedObject>)
    Splitter.SplitObjectsByPartsNumber(IEnumerable<ITimedObject>, int, TimeSpanType, TempoMap, Predicate<ITimedObject>)
    Splitter.SplitObjectsByStep(IEnumerable<ITimedObject>, ITimeSpan, TempoMap, Predicate<ITimedObject>)

    See Also

    IObservableTimedObjectsCollection
    In this article
    Back to top 2025 / Generated by DocFX