/// <summary> /// Creates <see cref="ISpan"/> from <see cref="IOrigination"/> and <see cref="Action"/>. /// </summary> /// <param name="origination"> /// <see cref="IOrigination"/> to originate in <see cref="ISpan"/>. /// </param> /// <param name="termination"> /// <see cref="Action"/> to terminate in <see cref="ISpan"/>. /// </param> /// <returns> /// <see cref="ISpan"/> created. /// </returns> /// <exception cref="ArgumentNullException"> /// Thrown if <paramref name="origination"/> is null. /// </exception> /// <exception cref="ArgumentNullException"> /// Thrown if <paramref name="termination"/> is null. /// </exception> public static ISpan To(this IOrigination origination, Action termination) { if (origination is null) { throw new ArgumentNullException(nameof(origination)); } if (termination is null) { throw new ArgumentNullException(nameof(termination)); } return(origination.To(new Termination(termination))); }
/// <summary> /// Binds <see cref="ICycle"/> to <see cref="IOrigination"/> and <see cref="ITermination"/>. /// </summary> /// <param name="cycle"> /// <see cref="ICycle"/> to be bound to <paramref name="origination"/> and <paramref name="termination"/>. /// </param> /// <param name="origination"> /// <see cref="IOrigination"/> to bind to <see cref="ICycle"/>. /// </param> /// <param name="termination"> /// <see cref="ITermination"/> to bind to <see cref="ICycle"/>. /// </param> /// <returns> /// <see cref="ICycle"/> bound. /// </returns> /// <exception cref="ArgumentNullException"> /// Thrown if <paramref name="cycle"/> is null. /// </exception> /// <exception cref="ArgumentNullException"> /// Thrown if <paramref name="origination"/> is null. /// </exception> /// <exception cref="ArgumentNullException"> /// Thrown if <paramref name="termination"/> is null. /// </exception> public static ICycle Between(this ICycle cycle, IOrigination origination, ITermination termination) { if (cycle is null) { throw new ArgumentNullException(nameof(cycle)); } if (origination is null) { throw new ArgumentNullException(nameof(origination)); } if (termination is null) { throw new ArgumentNullException(nameof(termination)); } return(cycle.In(origination.To(termination))); }