public bool injectIntoProcess(Process process, bool x64, bool runtime40, string sourceCodeFile) { //fixedCourceCode.showInCodeViewer(); var compileEngine = new CompileEngine(runtime40 ? "v4.0" : "v3.5") { useCachedAssemblyIfAvailable = false }; //var compiledAssembly = compileEngine.compileSourceCode(fixedCourceCode); var compiledAssembly = compileEngine.compileSourceFile(sourceCodeFile); return injectIntoProcess(process,x64, runtime40,compiledAssembly); }
public static List<String> compileAllFilesIndividually(List<String> filesToCompile, O2Thread.FuncVoidT1<string> currentTask, O2Thread.FuncVoidT1<int> numberOfStepsToPerform, O2Thread.FuncVoid onStepEvent) { currentTask("Compiling all rules individualy (one file at the time)"); numberOfStepsToPerform(filesToCompile.Count); var compileEngine = new CompileEngine(); PublicDI.log.info("Compiling All XRules source code files ONE at the time"); var results = new List<String>(); foreach (var fileToCompile in filesToCompile) { var assembly = compileEngine.compileSourceFile(fileToCompile); if (assembly != null) results.Add(assembly.Location); else PublicDI.log.error("In XRules_Execution.compileAllFilesIndividually, could not compile file: {0}", fileToCompile); onStepEvent(); } return results; }
public Assembly compileCSSharpFile() { Assembly compiledAssembly = null; var compileEngine = new CompileEngine(); if (getSourceCode() != "") { saveSourceCode(); // always save before compiling compileEngine.compileSourceFile(sPathToFileLoaded); compiledAssembly = compileEngine.compiledAssembly ?? null; if (compiledAssembly.notNull() && o2CodeCompletion.notNull() && compileEngine.cpCompilerParameters.notNull()) o2CodeCompletion.addReferences(compileEngine.cpCompilerParameters.ReferencedAssemblies.toList()); } var state = compiledAssembly == null && compileEngine.sbErrorMessage != null; //btShowHideCompilationErrors.visible(state); btShowHideCompilationErrors.prop("Visible",state); tvCompilationErrors.visible(state); lbCompilationErrors.prop("Visible", state); clearBookmarksAndMarkers(); // if there isn't a compiledAssembly, show errors if (compiledAssembly == null) { compileEngine.addErrorsListToTreeView(tvCompilationErrors); showErrorsInSourceCodeEditor(compileEngine.sbErrorMessage.str()); } else { if (compiledFileAstData.notNull()) compiledFileAstData.Dispose(); compiledFileAstData = new O2MappedAstData(sPathToFileLoaded); } return compiledAssembly; }