Exemple #1
0
 public IEnumerator <T> GetReverseEnumerator(int startIndex, int rangeCount)
 {
     if (thisStartIndex >= 0)
     {
         checkThisRangeCount(rangeCount, startIndex + 1);
         startIndex += thisStartIndex;
     }
     return(collection.GetReverseEnumerator(startIndex, rangeCount));
 }
Exemple #2
0
 public static IEnumerable <T> EnumerateInReverse <T>(this ISequenceView <T> sequenceView)
 {
     if (sequenceView == null)
     {
         throw new ArgumentNullException(nameof(sequenceView));
     }
     using (IEnumerator <T> enumerator = sequenceView.GetReverseEnumerator()) {
         while (enumerator.MoveNext())
         {
             yield return(enumerator.Current);
         }
     }
 }