Inheritance: CodeChecker
Exemplo n.º 1
0
        private void btnCompile_Click(object sender, EventArgs e)
        {
            bool input = (sender as Button).Name.Contains("Input");
            dgvCompileErrors.Rows.Clear();
            List<CheckingResult> compileResult;
            var cSharpChecker = new CSharpChecker();
            if (input)
                compileResult = cSharpChecker.Compile(tbInput.Text);
            else
                compileResult = cSharpChecker.CompileAndRun(tbOutput.Text);

            foreach (var result in compileResult)
            {
                if (result.IsError)
                    dgvCompileErrors.Rows.Add(result.FirstErrorLine.ToString(), result.FirstErrorColumn.ToString(),
                        result.Description, input ? "input" : "output");
            }

            if (!input)
            {
                if (compileResult.Count == 1 && compileResult.First().Output != null)
                {
                    tbConsoleOutput.ResetText();
                    tbConsoleOutput.Text = compileResult.First().Output;
                    if (cbScrollToEnd.Checked && tbConsoleOutput.Text.Length > 0)
                    {
                        tbConsoleOutput.Select(tbConsoleOutput.Text.Length - 1, 0);
                        tbConsoleOutput.ScrollToCaret();
                    }
                }
            }
        }
Exemplo n.º 2
0
 public void Init()
 {
     _cSharpChecker = new CSharpChecker();
     _javaChecker = new JavaChecker
     {
         JavaPath = Helpers.GetJavaExePath(@"bin\java.exe"),
         JavaCompilerPath = Helpers.GetJavaExePath(@"bin\javac.exe"),
         ClassName = "Program"
     };
     _phpChecker = new PhpChecker
     {
         PhpPath = @"C:\xampp\php\php.exe",
     };
 }
Exemplo n.º 3
0
 public void Init()
 {
     _cSharpChecker = new CSharpChecker();
 }