Skip to content

Commit

Permalink
update CmlLibWinFormSample
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaBs committed Jun 14, 2021
1 parent 9e79f67 commit 863a1b2
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 158 deletions.
153 changes: 37 additions & 116 deletions CmlLibWinFormSample/JavaForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 9 additions & 12 deletions CmlLibWinFormSample/JavaForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,36 @@ namespace CmlLibWinFormSample
{
public partial class JavaForm : Form
{
public bool UseMJava { get; set; }
public string MJavaDirectory { get; set; }
public string JavaBinaryPath { get; set; }

public JavaForm(bool useMJava, string mjavaDir, string javaPath)
public JavaForm(string javaPath)
{
this.UseMJava = useMJava;
this.MJavaDirectory = mjavaDir;
this.JavaBinaryPath = javaPath;

InitializeComponent();
}

private void JavaForm_Load(object sender, EventArgs e)
{
rbAutoJava.Checked = UseMJava;
txtJavaDirectory.Text = MJavaDirectory;
txtUserJava.Text = JavaBinaryPath;
if (string.IsNullOrEmpty(JavaBinaryPath))
cbAutoJava.Checked = true;
}

private void btnClose_Click(object sender, EventArgs e)
{
this.Close();
}

private void rbAutoJava_CheckedChanged(object sender, EventArgs e)
private void JavaForm_FormClosing(object sender, FormClosingEventArgs e)
{
gAutoJava.Enabled = rbAutoJava.Checked;
this.JavaBinaryPath = txtUserJava.Text;
}

private void rbUserJava_CheckedChanged(object sender, EventArgs e)
private void cbAutoJava_CheckedChanged(object sender, EventArgs e)
{
gUserJava.Enabled = rbUserJava.Checked;
if (cbAutoJava.Checked)
txtUserJava.Clear();
txtUserJava.Enabled = !cbAutoJava.Checked;
}
}
}
14 changes: 13 additions & 1 deletion CmlLibWinFormSample/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 863a1b2

Please sign in to comment.