Esempio n. 1
0
        public static EArray CreateArrayFromRuntimeArray <T>(params T[] loadElements)
        {
            Type   type     = typeof(T);
            EArray instance = CreateArraySpecifiedLength <T>(loadElements.Length);

            for (int i = 0; i < loadElements.Length; i += 1)
            {
                instance.StoreArray(i, loadElements[i]);
            }
            return(instance);
        }
Esempio n. 2
0
        public static EArray CreateArraySpecifiedLength(Type aType, int length)
        {
            EArray model = new EArray(aType);

            model.Length = length;
            if (length != -1)
            {
                model.il.REmit(OpCodes.Ldc_I4, length);
                model.il.REmit(OpCodes.Newarr, model.ElementType);
                model.il.REmit(OpCodes.Stloc, model.Builder);
            }
            return(model);
        }
Esempio n. 3
0
        public static EArray CreateArrayFromAction(Action loadAction, Type type)
        {
            EArray instance = new EArray(loadAction, type);

            return(instance);
        }
Esempio n. 4
0
        public static EArray CreateArray(Type type)
        {
            EArray instance = new EArray(type);

            return(instance);
        }
Esempio n. 5
0
        public static EArray CreateArrayFromParameter(int parameterIndex, Type type)
        {
            EArray instance = new EArray(parameterIndex, type);

            return(instance);
        }
Esempio n. 6
0
        public static EArray CreateArrayFromBuilder(LocalBuilder builder, Type type)
        {
            EArray instance = new EArray(builder, type);

            return(instance);
        }