/// <summary>Initializes a new instance of the <see cref="IEnumFromNext{TItem}" /> class.</summary> /// <param name="next">The method used to try to get the next item in the enumeration.</param> /// <param name="reset">The method used to reset the enumeration to the first element.</param> public IEnumFromNext(TryGetNext next, Action reset) { if (next == null || reset == null) { throw new ArgumentNullException(); } this.next = next; this.reset = reset; }
/// <summary>Initializes a new instance of the <see cref="IEnumeratorFromNext{TItem, TIEnum}"/> class.</summary> /// <param name="enumObj">The object to be enumerated.</param> /// <param name="next">The method used to get the next value.</param> /// <param name="reset">The method used to reset the enumeration.</param> /// <exception cref="ArgumentNullException">Thrown if any parameter is <see langword="null"/>.</exception> public IEnumeratorFromNext(TIEnum enumObj, TryGetNext <TIEnum, TItem> next, Action <TIEnum> reset) { if (enumObj == null || next == null || reset == null) { throw new ArgumentNullException(); } ienum = enumObj; this.next = next; this.reset = reset; reset(ienum); }