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); } }
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); } }