예제 #1
0
        /// <summary>
        /// Creates elist from list.
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        /// <remarks></remarks>
        public static EList <T> Create(IEnumerable <T> list)
        {
            EList <T> ret = new EList <T>();

            ret.AddRange(list);

            return(ret);
        }
예제 #2
0
        /// <summary>
        /// Removes item accepted by predicate from current collection and
        /// returns them in new collection.
        /// </summary>
        /// <param name="predicate">Predicate to match item to be removed.</param>
        /// <returns>Removed items in new list.</returns>
        /// <remarks></remarks>
        public EList <T> CutBy(System.Func <T, bool> predicate)
        {
            EList <T> ret = new EList <T>();

            ret = CutBy <EList <T> >(predicate);

            return(ret);
        }
예제 #3
0
        /// <summary>
        /// Cuts list into two parts by index.
        /// </summary>
        /// <param name="index">Index where to split.</param>
        /// <param name="excludeSplittingItem">If True, indexed item will not appear in any created lists.
        /// If False, indexed item will be the first in the second list.</param>
        /// <returns></returns>
        public virtual EList <T>[] SplitByIndex(int index, bool excludeSplittingItem)
        {
            List <T>[] pom = ((IList <T>) this).SplitByIndex(index, excludeSplittingItem);

            EList <T>[] ret = new EList <T> [2];
            ret[0] = EList <T> .Create(pom[0]);

            ret[1] = EList <T> .Create(pom[1]);

            return(ret);
        }
예제 #4
0
        /// <summary>
        /// Returns items in range from collection.
        /// </summary>
        /// <param name="startIndex">Start index, inclusive.</param>
        /// <param name="count">Count.</param>
        /// <returns></returns>
        public EList <T> EGetRange(int startIndex, int count)
        {
            EList <T> ret = EList <T> .Create(((IList <T>) this).EGetRange(startIndex, count));

            return(ret);
        }
예제 #5
0
        /// <summary>
        /// Returns items in range from collection, from index to the end of source list.
        /// </summary>
        /// <param name="startIndex">Start index, inclusive.</param>
        /// <returns></returns>
        public EList <T> EGetRange(int startIndex)
        {
            EList <T> ret = EGetRange(startIndex, this.Count - startIndex);

            return(ret);
        }