Exemplo n.º 1
0
        public override TextExpressionCompilerResults Compile(ClassToCompile classToCompile)
        {
            var scriptOptions = ScriptOptions.Default.WithReferences(classToCompile.ReferencedAssemblies.GetMetadataReferences()).WithImports(classToCompile.ImportedNamespaces);
            var script        = Create(classToCompile.Code, scriptOptions);
            var results       = BuildAssembly(script.GetCompilation());

            if (results.HasErrors)
            {
                return(results);
            }
            results.ResultType = results.ResultType.GetNestedType(classToCompile.ClassName);
            return(results);
        }
Exemplo n.º 2
0
 public abstract TextExpressionCompilerResults Compile(ClassToCompile classToCompile);