Esempio n. 1
0
 public static void AddRange <T> (this List <T> list, IEnumerable <T> items, ItemPosition position = ItemPosition.Top)
 {
     if (position.ToBool())
     {
         list.InsertRange(0, items);
     }
     else
     {
         list.AddRange(items);
     }
 }
Esempio n. 2
0
 public static void Add <T> (this IList <T> list, T item, ItemPosition position = ItemPosition.Top)
 {
     if (position.ToBool(ItemPosition.Top))
     {
         list.Insert(0, item);
     }
     else
     {
         list.Add(item);
     }
 }