Ejemplo n.º 1
0
        private IRuntimeAssembly GetAssembly(string assyCode)
        {
            IRuntimeAssembly t = null;
            List <string>    errors;
            Assembly         assy = Compiler.Compile(assyCode, out errors, References);

            if (assy == null)
            {
                proc.IfNotNull((p) => errors.ForEach(errMsg => p.ProcessInstance <LoggerMembrane, ST_CompilerError>(err => err.Error = errMsg)));
                throw new TemplateEngineException(errors);
            }
            else
            {
                t = (IRuntimeAssembly)assy.CreateInstance("RuntimeCompiled");
            }

            return(t);
        }