Пример #1
0
        private static Assembly loadCompiledAssembly()
        {
            Dictionary <Type, ObservedType> observers = loadObservers();
            String proxyCode = AopCoder.GetProxyClassCode(observers);

            return(CodeDomHelper.CompileCode(proxyCode, ObjectContext.Instance.AssemblyList, null));
        }
Пример #2
0
        private static IMysqlHelper loadMysqlHelper()
        {
            String code = makeCode();

            Dictionary <String, Assembly> asmList = getMysqlAsmList();
            Assembly asm = CodeDomHelper.CompileCode(code, asmList, null);

            return(asm.CreateInstance("wojilu.Data.MysqlHelper") as IMysqlHelper);
        }
Пример #3
0
        internal static Dictionary <String, IControllerFactory> GetCompiledFactory()
        {
            Assembly asm = CodeDomHelper.CompileCode(getControllerFactoryCode(), ObjectContext.Instance.AssemblyList, null);

            Dictionary <String, IControllerFactory> factories = new Dictionary <String, IControllerFactory>();

            List <Type> types = getControllerTypes();

            foreach (Type t in types)
            {
                factories.Add(t.FullName, (IControllerFactory)asm.CreateInstance(getFactoryNameWithNs(t.FullName)));
            }

            return(factories);
        }
Пример #4
0
        private ITemplateResult compileCode(String clsName)
        {
            String code = this.GetCode(clsName);

            Assembly asm;

            try {
                asm = CodeDomHelper.CompileCode(code, ObjectContext.Instance.AssemblyList, getTempDllPath2(clsName));
            }
            catch (Exception ex) {
                throw new TemplateCompileException("模板编译错误", ex);
            }

            return(asm.CreateInstance("wojilu." + clsName) as ITemplateResult);
        }