예제 #1
0
        public static ExtendedList <T> FromList(List <T> list)
        {
            ExtendedList <T> result = new ExtendedList <T>();

            foreach (T item in list)
            {
                result.Add(item);
            }
            return(result);
        }
예제 #2
0
        public ExtendedList <TNew> Parse <TNew>(Func <T, TNew> selector) where TNew : class
        {
            ExtendedList <TNew> result = new ExtendedList <TNew>();

            foreach (T item in this)
            {
                result.Add(selector(item));
            }
            return(result);
        }
예제 #3
0
        public static ExtendedList <T> FromArray(Array array)
        {
            ExtendedList <T> result = new ExtendedList <T>();

            foreach (T item in array)
            {
                result.Add(item);
            }
            return(result);
        }
예제 #4
0
        public ExtendedList <TNew> ParseNullable <TNew>(Func <T, TNew> selector)
        {
            ExtendedList <TNew> result = new ExtendedList <TNew>();

            foreach (T item in this)
            {
                if (item == null)
                {
                    result.Add(default(TNew));
                }
                else
                {
                    result.Add(selector(item));
                }
            }
            return(result);
        }