Exemple #1
0
        public virtual object Clone()
        {
            TestObjectList collection = new TestObjectList(this._count);

            Array.Copy(this._array, 0, collection._array, 0, this._count);
            collection._count   = this._count;
            collection._version = this._version;

            return(collection);
        }
Exemple #2
0
        public TestObjectList(TestObjectList collection)
        {
            if (collection == null)
            {
                throw new ArgumentNullException("collection");
            }

            this._array = new TestObject[collection.Count];
            AddRange(collection);
        }
Exemple #3
0
        public virtual void AddRange(TestObjectList collection)
        {
            if (collection == null)
            {
                throw new ArgumentNullException("collection");
            }

            if (collection.Count == 0)
            {
                return;
            }
            if (this._count + collection.Count > this._array.Length)
            {
                EnsureCapacity(this._count + collection.Count);
            }

            ++this._version;
            Array.Copy(collection.InnerArray, 0,
                       this._array, this._count, collection.Count);
            this._count += collection.Count;
        }
Exemple #4
0
 internal Enumerator(TestObjectList collection)
 {
     this._collection = collection;
     this._version    = collection._version;
     this._index      = -1;
 }