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

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

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