Esempio n. 1
0
 internal Enumerator(TestList <T> list)
 {
     this.list = list;
     index     = 0;
     version   = list._version;
     current   = default(T);
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
            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());
            }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
 internal SynchronizedList(TestList <T> list)
 {
     _list = list;
     _root = ((System.Collections.ICollection)list).SyncRoot;
 }
Esempio n. 7
0
 internal static IList <T> Synchronized(TestList <T> list)
 {
     return(new SynchronizedList(list));
 }