public T this[int index] { get { Invariant.ArgumentIsInRange <int>(index, "index", new Range <int>(0, this.Count - 1)); return(this.items[index]); } }
T IList <T> .this[int index] { get { Invariant.ArgumentIsInRange <int>(index, "index", new Range <int>(0, this.Count - 1)); return(this[index]); } set { throw new NotSupportedException(); } }
public static void InsertRange <TItem>(this IList <TItem> self, int index, IEnumerable <TItem> items) { Invariant.ArgumentIsInRange <int>(index, "index", new Range <int>(0, self.Count)); List <TItem> objList = self as List <TItem>; if (objList != null) { objList.InsertRange(index, items); } else { foreach (TItem obj in items) { self.Insert(index++, obj); } } }
public void RemoveAt(int index) { Invariant.ArgumentIsInRange <int>(index, "index", new Range <int>(0, this.Count - 1)); this.items.RemoveAt(index); }