Ejemplo n.º 1
0
        public TestObjectList(TestObjectList collection)
        {
            if (collection == null)
            {
                throw new ArgumentNullException("collection");
            }

            this._array = new TestObject[collection.Count];
            AddRange(collection);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 4
0
 internal Enumerator(TestObjectList collection)
 {
     this._collection = collection;
     this._version    = collection._version;
     this._index      = -1;
 }
Ejemplo n.º 5
0
 internal Enumerator(TestObjectList collection)
 {
     this._collection = collection;
     this._version = collection._version;
     this._index = -1;
 }
Ejemplo n.º 6
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;
        }
Ejemplo n.º 7
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;
        }
Ejemplo n.º 8
0
        public TestObjectList(TestObjectList collection)
        {
            if (collection == null)
                throw new ArgumentNullException("collection");

            this._array = new TestObject[collection.Count];
            AddRange(collection);
        }