internal Enumerator(TestList <T> list) { this.list = list; index = 0; version = list._version; current = default(T); }
public TestList <T> GetRange(int index, int count) { if (index < 0) { { } } if (count < 0) { { } } if (_size - index < count) { { } } Contract.Ensures(Contract.Result <TestList <T> >() != null); Contract.EndContractBlock(); TestList <T> list = new TestList <T>(count); Array.Copy(_items, index, list._items, 0, count); list._size = count; return(list); }
public bool MoveNext() { TestList <T> localList = list; if (version == localList._version && ((uint)index < (uint)localList._size)) { current = localList._items[index]; index++; return(true); } return(MoveNextRare()); }
public TestList <T> FindAll(Predicate <T> match) { if (match == null) { { } } Contract.EndContractBlock(); TestList <T> list = new TestList <T>(); for (int i = 0; i < _size; i++) { if (match(_items[i])) { list.Add(_items[i]); } } return(list); }
public TestList <TOutput> ConvertAll <TOutput>(Converter <T, TOutput> converter) { if (converter == null) { { } } // @ Contract.EndContractBlock(); TestList <TOutput> list = new TestList <TOutput>(_size); for (int i = 0; i < _size; i++) { list._items[i] = converter(_items[i]); } list._size = _size; return(list); }
internal SynchronizedList(TestList <T> list) { _list = list; _root = ((System.Collections.ICollection)list).SyncRoot; }
internal static IList <T> Synchronized(TestList <T> list) { return(new SynchronizedList(list)); }