public void Insert(int index, T item) { if (index <= _list.Count) { _list.Insert(index, item); } else if (index - _list.Count <= SecondaryList.Count) { SecondaryList.Insert(index - _list.Count, item); } else { throw new ArgumentOutOfRangeException("index", "Index is out of range"); } }
public bool Remove(T item) { return(_list.Remove(item) || SecondaryList.Remove(item)); }
public void Clear() { _list.Clear(); SecondaryList.Clear(); }