private void ConfigForm_Load(object sender, EventArgs e) { try { textBoxMPCLocation.Text = MPCControlForm.GetMPCPath(); checkBoxAutoSave.Checked = GetAutoSaveOnEdit(); checkBoxFindRegex.Checked = GetFindRegex(); checkBoxHighlightInvalid.Checked = GetHighlightInvalidCells(); checkBoxHighlightCounter.Checked = GetHighlightCounter(); checkBoxAutoDuration.Checked = GetAutoDuration(); textBoxDurationConstant.Text = (((double)GetDurationConstant()) / 1000).ToString(); textBoxDurationVariable.Text = (((double)GetDurationVariable()) / 1000).ToString(); textBoxDurationMin.Text = (((double)GetDurationMinimum()) / 1000).ToString(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void okButton_Click(object sender, EventArgs e) { try { MPCControlForm.SetMPCPath(textBoxMPCLocation.Text); SetAutoSaveOnEdit(checkBoxAutoSave.Checked); SetFindRegex(checkBoxFindRegex.Checked); SetHighlightInvalidCells(checkBoxHighlightInvalid.Checked); SetHighlightCounter(checkBoxHighlightInvalid.Checked); SetAutoDuration(checkBoxAutoDuration.Checked); SetDurationConstant((int)(Convert.ToDouble(textBoxDurationConstant.Text) * 1000)); SetDurationVariable((int)(Convert.ToDouble(textBoxDurationVariable.Text) * 1000)); SetDurationMinimum((int)(Convert.ToDouble(textBoxDurationMin.Text) * 1000)); Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }