Ejemplo n.º 1
0
 //--------------------------------------------------------------------------------------------------------------
 public static void AddRange <TEnumerator, TSource> (
     this IList <TSource> list,
     EnumerableAdapter <TEnumerator, TSource> enumerable
     )
     where TEnumerator : IAdaptableEnumerator <TSource>
 {
     foreach (var element in enumerable)
     {
         list.Add(item: element);
     }
 }
Ejemplo n.º 2
0
 //--------------------------------------------------------------------------------------------------------------
 public static void PushRange <TEnumerator, TSource> (
     this Stack <TSource> stack,
     EnumerableAdapter <TEnumerator, TSource> enumerable
     )
     where TEnumerator : IAdaptableEnumerator <TSource>
 {
     foreach (var element in enumerable)
     {
         stack.Push(item: element);
     }
 }
Ejemplo n.º 3
0
 //--------------------------------------------------------------------------------------------------------------
 public static void EnqueueRange <TEnumerator, TSource> (
     this Queue <TSource> queue,
     EnumerableAdapter <TEnumerator, TSource> enumerable
     )
     where TEnumerator : IAdaptableEnumerator <TSource>
 {
     foreach (var element in enumerable)
     {
         queue.Enqueue(item: element);
     }
 }
Ejemplo n.º 4
0
 //--------------------------------------------------------------------------------------------------------------
 public static void Add <TEnumerator, TSource> (
     this IList <TSource> list,
     EnumerableAdapter <TEnumerator, TSource> enumerable
     )
     where TEnumerator : IAdaptableEnumerator <TSource>
 => list.AddRange(enumerable : enumerable);