Example #1
0
        static void Main()
        {
            string code = File.ReadAllText(ProgramPath);

            var compiler = new CSharpCompiler();
            compiler.Compile(code);
            compiler.Execute(EntryClassName);
        }
Example #2
0
        static void Main()
        {
            string code = File.ReadAllText(ProgramPath);

            var compiler = new CSharpCompiler();
            compiler.Compile(code);
            compiler.Execute(EntryClassName);
        }
Example #3
0
        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);
 }
Example #5
0
        static void Main()
        {
            string code = File.ReadAllText(ProgramPath);

            IValidationStrategy strategy = new CodeLengthValidator();
            var compiler = new CSharpCompiler(strategy);

            compiler.Compile(code);
            compiler.Execute(EntryClassName);
        }
Example #6
0
        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);
            }
        }