Search Results for

    Show / Hide Table of Contents

    Interface ITimeSpan

    Time span that represents time or length.
    Inherited Members
    IComparable.CompareTo(object)
    Namespace: Melanchall.DryWetMidi.Interaction
    Assembly: Melanchall.DryWetMidi.dll
    Syntax
    public interface ITimeSpan : IComparable

    Methods

    Add(ITimeSpan, TimeSpanMode)

    Adds a time span to the current one.
    Declaration
    ITimeSpan Add(ITimeSpan timeSpan, TimeSpanMode mode)
    Parameters
    Type Name Description
    ITimeSpan timeSpan Time span to add to the current one.
    TimeSpanMode mode Mode of the operation that defines meaning of time spans the operation will be performed on.
    Returns
    Type Description
    ITimeSpan Time span that is a sum of the timeSpan and the current time span.
    Remarks
    If timeSpan and the current time span have the same type, the result time span will be of this type too; otherwise - of the MathTimeSpan.
    Exceptions
    Type Condition
    ArgumentNullException timeSpan is invalid.
    InvalidEnumArgumentException mode specified an invalid value.

    Clone()

    Clones the current time span.
    Declaration
    ITimeSpan Clone()
    Returns
    Type Description
    ITimeSpan Copy of the current time span.

    Divide(double)

    Shrinks the current time span by dividing its length by the specified divisor.
    Declaration
    ITimeSpan Divide(double divisor)
    Parameters
    Type Name Description
    double divisor Divisor to shrink the time span by.
    Returns
    Type Description
    ITimeSpan Time span that is the current time span shrinked by the divisor.
    Exceptions
    Type Condition
    ArgumentOutOfRangeException divisor is zero or negative.

    Multiply(double)

    Stretches the current time span by multiplying its length by the specified multiplier.
    Declaration
    ITimeSpan Multiply(double multiplier)
    Parameters
    Type Name Description
    double multiplier Multiplier to stretch the time span by.
    Returns
    Type Description
    ITimeSpan Time span that is the current time span stretched by the multiplier.
    Exceptions
    Type Condition
    ArgumentOutOfRangeException multiplier is negative.

    Subtract(ITimeSpan, TimeSpanMode)

    Subtracts a time span from the current one.
    Declaration
    ITimeSpan Subtract(ITimeSpan timeSpan, TimeSpanMode mode)
    Parameters
    Type Name Description
    ITimeSpan timeSpan Time span to subtract from the current one.
    TimeSpanMode mode Mode of the operation that defines meaning of time spans the operation will be performed on.
    Returns
    Type Description
    ITimeSpan Time span that is a difference between the timeSpan and the current time span.
    Remarks
    If timeSpan and the current time span have the same type, the result time span will be of this type too; otherwise - of the MathTimeSpan.
    Exceptions
    Type Condition
    ArgumentNullException timeSpan is invalid.
    InvalidEnumArgumentException mode specified an invalid value.

    Extension Methods

    TimeSpanUtilities.IsZeroTimeSpan(ITimeSpan)
    TimeSpanUtilities.Round(ITimeSpan, TimeSpanRoundingPolicy, long, ITimeSpan, TempoMap)
    In this article
    Back to top 2024 / Generated by DocFX