public JavaAppConfigurationDialog(JavaApplication application) { Application = application; InitializeComponent(); TagRadioButtons(); SetDefaultIcon(); appNameTextBox.Text = application.Name; jarFilePathTextBox.Text = application.JarFilePath; if (!string.IsNullOrWhiteSpace(application.JavaExecutablePath)) { customPathRadioButton.Checked = true; customPathTextBox.Text = application.JavaExecutablePath; customPathTextBox.Enabled = true; selectJavaExePathButton.Enabled = true; } else { usePathVariableRadioButton.Checked = true; } iconSelector.Icon = application.Icon.Image; }
private void okButton_Click(object sender, EventArgs e) { //Check if game name is empty if (appNameTextBox.Text == string.Empty) { Utilities.MessageBoxes.Warning("Game name is empty!"); return; } //Check if jar file path is empty if (jarFilePathTextBox.Text == string.Empty) { Utilities.MessageBoxes.Warning("Jar file path is empty!"); return; } if (!File.Exists(jarFilePathTextBox.Text)) { Utilities.MessageBoxes.Warning("Provided jar file does not exist!"); return; } var javaExecutablePath = GetJavaExecutablePath(); if (javaExecutablePath == null) { return; } Application = new JavaApplication( appNameTextBox.Text, jarFilePathTextBox.Text, javaExecutablePath, iconSelector.Icon); DialogResult = DialogResult.OK; Close(); }
public JavaAppFactory(JavaApplication application) { Application = application; }