예제 #1
0
 public bool Contains(TestObject value)
 {
     return(IndexOf(value) >= 0);
 }
예제 #2
0
 public virtual int IndexOf(TestObject value)
 {
     return(Array.IndexOf(this._array, value, 0, this._count));
 }
 public void WithNonSerializableObject()
 {
     TestObject o = new TestObject();
     Assert.IsFalse(o is ISerializable);
     Assert.IsFalse(IsSerializable(o));
     TrySerialization(o);
 }
예제 #4
0
 public virtual int BinarySearch(TestObject value)
 {
     return(Array.BinarySearch(this._array, 0, this._count, value));
 }
예제 #5
0
 public virtual void Remove(TestObject value)
 {
     int index = IndexOf(value);
     if (index >= 0) RemoveAt(index);
 }
예제 #6
0
 public virtual TestObject[] ToArray()
 {
     TestObject[] array = new TestObject[this._count];
     Array.Copy(this._array, array, this._count);
     return array;
 }
예제 #7
0
 public virtual int IndexOf(TestObject value)
 {
     return Array.IndexOf(this._array, value, 0, this._count);
 }
예제 #8
0
        public virtual int Add(TestObject value)
        {
            if (this._count == this._array.Length)
                EnsureCapacity(this._count + 1);

            ++this._version;
            this._array[this._count] = value;
            return this._count++;
        }
예제 #9
0
 public virtual void CopyTo(TestObject[] array)
 {
     CheckTargetArray(array, 0);
     Array.Copy(this._array, array, this._count);
 }
예제 #10
0
 public virtual void CopyTo(TestObject[] array, int arrayIndex)
 {
     CheckTargetArray(array, arrayIndex);
     Array.Copy(this._array, 0, array, arrayIndex, this._count);
 }
예제 #11
0
 public bool Contains(TestObject value)
 {
     return (IndexOf(value) >= 0);
 }
예제 #12
0
 public virtual int BinarySearch(TestObject value)
 {
     return Array.BinarySearch(this._array, 0, this._count, value);
 }
예제 #13
0
        public virtual void AddRange(TestObject[] array)
        {
            if (array == null)
                throw new ArgumentNullException("array");

            if (array.Length == 0) return;
            if (this._count + array.Length > this._array.Length)
                EnsureCapacity(this._count + array.Length);

            ++this._version;
            Array.Copy(array, 0, this._array, this._count, array.Length);
            this._count += array.Length;
        }
예제 #14
0
 public virtual TestObject[] ToArray()
 {
     TestObject[] array = new TestObject[this._count];
     Array.Copy(this._array, array, this._count);
     return(array);
 }
예제 #15
0
        public virtual void Insert(int index, TestObject value)
        {
            if (index < 0)
                throw new ArgumentOutOfRangeException("index",
                                                      index, "Argument cannot be negative.");

            if (index > this._count)
                throw new ArgumentOutOfRangeException("index",
                                                      index, "Argument cannot exceed Count.");

            if (this._count == this._array.Length)
                EnsureCapacity(this._count + 1);

            ++this._version;
            if (index < this._count)
                Array.Copy(this._array, index,
                           this._array, index + 1, this._count - index);

            this._array[index] = value;
            ++this._count;
        }
예제 #16
0
 public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object text_obj)
 {
     if (text_obj is string)
     {
         string text = (string) text_obj;
         TestObject tb = new TestObject();
         string[] split = text.Split(new char[] {'_'});
         tb.Name = split[0];
         tb.Age = int.Parse(split[1]);
         return tb;
     }
     return base.ConvertFrom(context, culture, text_obj);
 }
예제 #17
0
        public TestObjectList(TestObject[] array)
        {
            if (array == null)
                throw new ArgumentNullException("array");

            this._array = new TestObject[array.Length];
            AddRange(array);
        }