public TestObjectList(TestObjectList collection)
        {
            if (collection == null)
            {
                throw new ArgumentNullException("collection");
            }

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

			this._array = new TestObject[collection.Count];
			AddRange(collection);
		}
Beispiel #6
0
			internal Enumerator(TestObjectList collection)
			{
				this._collection = collection;
				this._version = collection._version;
				this._index = -1;
			}
Beispiel #7
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;
		}
Beispiel #8
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;
		}