Example #1
0
        public override bool Equals(object other)
        {
            if (object.ReferenceEquals(this, other))
            {
                return(true);
            }
            try
            {
                CollectionBase <T> c = (CollectionBase <T>)other;
                if (list_.Count != c.list_.Count)
                {
                    return(false);
                }
                if (list_.Count == 0)
                {
                    return(true);
                }
                for (int i = 0; i < list_.Count; ++i)
                {
                    if (!Equals(list_[i], c.list_[i]))
                    {
                        return(false);
                    }
                }
            }
            catch (System.Exception)
            {
                return(false);
            }

            return(true);
        }
Example #2
0
 public virtual void SetRange(int index, CollectionBase <T> c)
 {
     if (c == null)
     {
         throw new ArgumentNullException("c", "Collection must not be null for SetRange()");
     }
     if (index < 0 || index + c.Count > list_.Count)
     {
         throw new ArgumentOutOfRangeException("index", "Index out of range");
     }
     for (int i = index; i < list_.Count; ++i)
     {
         list_[i] = c[i - index];
     }
 }
Example #3
0
 public void AddRange(CollectionBase <T> s__)
 {
     list_.AddRange(s__.list_);
 }
Example #4
0
 public virtual void InsertRange(int index, CollectionBase <T> c)
 {
     list_.InsertRange(index, c.list_);
 }