private void RunProgramButton_Click(object sender, RoutedEventArgs e) { if (_pathToDecryptedFile == "") { MessageBox.Show("File is not decrypted!"); return; } var parentFolder = Path.GetDirectoryName(_pathToDecryptedFile); var fileNameWithoutExt = Path.GetFileNameWithoutExtension(_pathToDecryptedFile); var fileExt = Path.GetExtension(_pathToDecryptedFile); string compileProgram; string runProgram; if (fileExt == ".c" || fileExt == ".cpp") { compileProgram = $"gcc -o {parentFolder}/{fileNameWithoutExt}.exe {parentFolder}/{fileNameWithoutExt}{fileExt}"; runProgram = $"{parentFolder}/{fileNameWithoutExt}.exe"; } else if (fileExt == ".java") { compileProgram = $"javac {parentFolder}/{fileNameWithoutExt}{fileExt}"; runProgram = $"java {parentFolder}/{fileNameWithoutExt}.java"; } else { MessageBox.Show("It is not source code file!"); return; } MakeCertificateWindow.RunCommand(compileProgram); MakeCertificateWindow.RunCommand(runProgram); }
private void MakeCertificateClick(object sender, RoutedEventArgs e) { var mcw = new MakeCertificateWindow(this); mcw.Show(); Hide(); }