Beispiel #1
0
 void IList.Remove(object item)
 {
     if (!ListX <T> .IsCompatibleObject(item))
     {
         return;
     }
     this.Remove((T)item);
 }
Beispiel #2
0
 public int IndexOf(object item)
 {
     if (ListX <T> .IsCompatibleObject(item))
     {
         return(this.IndexOf((T)item));
     }
     return(-1);
 }
Beispiel #3
0
        public ListX <T> GetRange(int index, int count)
        {
            ListX <T> objListX = new ListX <T>(count);

            Array.Copy((Array)this._items, index, (Array)objListX._items, 0, count);
            objListX._size = count;
            return(objListX);
        }
Beispiel #4
0
 bool IList.Contains(object item)
 {
     if (ListX <T> .IsCompatibleObject(item))
     {
         return(this.Contains((T)item));
     }
     return(false);
 }
Beispiel #5
0
        public ListX <V> Map <U, V>(U target, Func <T, U, V> mapFn)
        {
            ListX <V> retn = new ListX <V>(_size);

            for (int i = 0; i < _size; i++)
            {
                retn.Add(mapFn(_items[i], target));
            }
            return(retn);
        }
Beispiel #6
0
        public ListX <U> Map <U>(Func <T, U> mapFn)
        {
            ListX <U> retn = new ListX <U>(_size);

            for (int i = 0; i < _size; i++)
            {
                retn.Add(mapFn(_items[i]));
            }
            return(retn);
        }
Beispiel #7
0
        public ListX <T> FindAll(Predicate <T> match)
        {
            ListX <T> objListX = new ListX <T>();

            for (int index = 0; index < this._size; ++index)
            {
                if (match(this._items[index]))
                {
                    objListX.Add(this._items[index]);
                }
            }
            return(objListX);
        }
Beispiel #8
0
        public ListX <T> FindAll <U>(U target, Func <T, U, bool> predicate)
        {
            ListX <T> retn   = new ListX <T>(4);
            int       length = _size;

            for (int i = 0; i < length; i++)
            {
                if (predicate(_items[i], target))
                {
                    retn.Add(_items[i]);
                }
            }
            return(retn);
        }
Beispiel #9
0
 internal Enumerator(ListX <T> listX)
 {
     this.listX   = listX;
     this.index   = 0;
     this.current = default(T);
 }