Exemplo n.º 1
0
        ///// <summary>
        ///// Create Array From current ImportDataFrom IEnumerable
        ///// </summary>
        //public static T[] A<T>(this IEnumerable<T> ImportDataFrom)
        //{
        //    if (ImportDataFrom == null)
        //        return null;
        //    return ImportDataFrom.ToArray();
        //}

        /// <summary>
        /// Create Array with current Items No 0-2  and more ItemsNo3_AndMore if necessary
        /// </summary>
        public static T[] A <T>(this T ItemNo_0, T ItemNo_1, T ItemNo_2, params T[] MoreItems)
        {
            var Result = new T[3] {
                ItemNo_0, ItemNo_1, ItemNo_2
            };

            if (MoreItems.C())
            {
                return(Result.Gc(MoreItems).ToArray());
            }
            return(Result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Create IEnumerable with current Items No 0-5 and MoreItems if necessary
        /// </summary>
        public static IEnumerable <T> I <T>(this T ItemNo_0, T ItemNo_1, T ItemNo_2, T ItemNo_3, T ItemNo_4, T ItemNo_5, params T[] MoreItems)
        {
            var Result = new List <T>()
            {
                ItemNo_0, ItemNo_1, ItemNo_2, ItemNo_3, ItemNo_4, ItemNo_5
            };

            if (MoreItems.C())
            {
                Result.AddRange(MoreItems);
            }
            return(Result);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Create New Dictionary with two items with current Keys and Func Method Values
        /// </summary>
        public static IDictionary <KeyT, ValueT> Df <KeyT, ValueT>(this KeyT Key1, KeyT Key2, f <KeyT, ValueT> Value1, f <KeyT, ValueT> Value2, KeyValuePair <KeyT, f <KeyT, ValueT> > Val3, KeyValuePair <KeyT, f <KeyT, ValueT> >?Val4 = null, params KeyValuePair <KeyT, f <KeyT, ValueT> >[] MoreItems)
        {
            var res = new Dictionary <KeyT, ValueT>();

            res.Add(Key1, Value1(Key1));
            res.Add(Key2, Value2(Key2));
            res.Add(Val3.Key, Val3.Value(Val3.Key));
            if (Val4 != null)
            {
                res.Add(Val4.Value.Key, Val4.Value.Value(Val4.Value.Key));
            }
            if (MoreItems.C())
            {
                foreach (var item in MoreItems)
                {
                    res.Add(item.Key, item.Value(item.Key));
                }
            }
            return(res);
        }