static void Main() { string code = File.ReadAllText(ProgramPath); var compiler = new CSharpCompiler(); compiler.Compile(code); compiler.Execute(EntryClassName); }
public static void Main() { string code = File.ReadAllText(ProgramPath); IValidationStrategy strategy = new CodeLengthValidator(); var compiler = new CSharpCompiler(strategy); compiler.Compile(code); compiler.Execute(EntryClassName); }
static void Main() { string code = File.ReadAllText(ProgramPath); ICodeSyntaxValidationStrategy codeValidationStrategy = new CodeLengthValidator(); // codeValidationStrategy = new SystemNetValidator(); var compiler = new CSharpCompiler(codeValidationStrategy); compiler.Compile(code); compiler.Execute(EntryClassName); }
static void Main() { string code = File.ReadAllText(ProgramPath); IValidationStrategy strategy = new CodeLengthValidator(); var compiler = new CSharpCompiler(strategy); compiler.Compile(code); compiler.Execute(EntryClassName); }
static void Main() { try { string code = File.ReadAllText(ProgramPath); ICodeValidationStrategy strategy = new CodeLenghtValidator(); strategy = new SystemNetValidator(); var compiler = new CSharpCompiler(strategy); compiler.Compile(code); compiler.Execute(EntryClassName); } catch (CompilationException ex) { Console.WriteLine(ex.Message); } }