Exemplo n.º 1
0
        internal static ReaderToModel GetReaderToModel(Type t)
        {
            ReaderToModel ic          = null;
            Type          convertType = null;

            if (!cacheDic.TryGetValue(t, out convertType))
            {
                if (convertType == null)
                {
                    convertType = CreateReaderToModelType(t);
                    if (convertType != null && !cacheDic.ContainsKey(t))
                    {
                        cacheDic[t] = convertType;
                    }
                }
            }

            if (convertType != null)
            {
                ic = Activator.CreateInstance(convertType) as ReaderToModel;
            }

            //assbuilder.Save("Afx.Data.Extensions.Dynamic.dll");

            return(ic);
        }
Exemplo n.º 2
0
        private static System.Collections.Concurrent.ConcurrentDictionary <Type, List <EnumInfoModel> > GetLangueDic(string langue)
        {
            System.Collections.Concurrent.ConcurrentDictionary <Type, List <EnumInfoModel> > dic = null;
#endif
            if (!enumDic.TryGetValue(langue, out dic))
            {
                enumDic[langue] = dic = new System.Collections.Concurrent.ConcurrentDictionary <Type, List <EnumInfoModel> >();
            }

            return(dic);
        }
Exemplo n.º 3
0
        private static IModelToParam GetModelToParam(Type t)
        {
            IModelToParam setParam     = null;
            Type          setParamType = null;

            if (!setParamDic.TryGetValue(t, out setParamType))
            {
                if (setParamType == null)
                {
                    setParamType = CreateModelToParamType(t);
                    if (setParamType != null && !setParamDic.ContainsKey(t))
                    {
                        setParamDic[t] = setParamType;
                    }
                }
            }

            if (setParamType != null)
            {
                setParam = Activator.CreateInstance(setParamType) as IModelToParam;
            }

            return(setParam);
        }
Exemplo n.º 4
0
        private static IReaderToModel GetReaderToModel(Type t)
        {
            IReaderToModel ic          = null;
            Type           convertType = null;

            if (!cacheDic.TryGetValue(t, out convertType))
            {
                if (convertType == null)
                {
                    convertType = CreateReaderToModelType(t);
                    if (convertType != null && !cacheDic.ContainsKey(t))
                    {
                        cacheDic[t] = convertType;
                    }
                }
            }

            if (convertType != null)
            {
                ic = Activator.CreateInstance(convertType) as IReaderToModel;
            }

            return(ic);
        }