public ITimeSpan Add(ITimeSpan timeSpan, TimeSpanMode mode) { ThrowIfArgument.IsNull(nameof(timeSpan), timeSpan); var barBeatFractionTimeSpan = timeSpan as BarBeatFractionTimeSpan; return(barBeatFractionTimeSpan != null ? this + barBeatFractionTimeSpan : TimeSpanUtilities.Add(this, timeSpan, mode)); }
/// <summary> /// Adds a time span to the current one. /// </summary> /// <remarks> /// If <paramref name="timeSpan"/> and the current time span have the same type, /// the result time span will be of this type too; otherwise - of the <see cref="MathTimeSpan"/>. /// </remarks> /// <param name="timeSpan">Time span to add to the current one.</param> /// <param name="mode">Mode of the operation that defines meaning of time spans the /// operation will be performed on.</param> /// <returns>Time span that is a sum of the <paramref name="timeSpan"/> and the /// current time span.</returns> /// <exception cref="ArgumentException"><paramref name="mode"/> is invalid.</exception> public ITimeSpan Add(ITimeSpan timeSpan, TimeSpanMode mode) { ThrowIfArgument.IsNull(nameof(timeSpan), timeSpan); var midiTimeSpan = timeSpan as MidiTimeSpan; return(midiTimeSpan != null ? this + midiTimeSpan : TimeSpanUtilities.Add(this, timeSpan, mode)); }
/// <summary> /// Adds a time span to the current one. /// </summary> /// <remarks> /// If <paramref name="timeSpan"/> and the current time span have the same type, /// the result time span will be of this type too; otherwise - of the <see cref="MathTimeSpan"/>. /// </remarks> /// <param name="timeSpan">Time span to add to the current one.</param> /// <param name="mode">Mode of the operation that defines meaning of time spans the /// operation will be performed on.</param> /// <returns>Time span that is a sum of the <paramref name="timeSpan"/> and the /// current time span.</returns> /// <exception cref="ArgumentException"><paramref name="mode"/> is invalid.</exception> public ITimeSpan Add(ITimeSpan timeSpan, TimeSpanMode mode) { ThrowIfArgument.IsNull(nameof(timeSpan), timeSpan); return(TimeSpanUtilities.Add(this, timeSpan, mode)); }