using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace M423project { public partial class FormGetRunMode : Form { SystemRunMode rm = new SystemRunMode(); public SystemRunMode RunMode { get { return rm; } } public bool _repeat; public FormGetRunMode(SystemRunMode _rm,bool repeat) { InitializeComponent(); rm = _rm; _repeat = repeat; } private void FormGetRunMode_Load(object sender, EventArgs e) { if (_repeat) { rbRepeat.Checked = true; return; } rbTest.Checked = rm.runMode == true; tbRunTimes.Enabled = rbTest.Checked; tbRunTimes.Text = rm.runTimes.ToString(); } private void button1_Click(object sender, EventArgs e) { rm.runMode = rbTest.Checked; ushort v; if (ushort.TryParse(tbRunTimes.Text, out v)) rm.runTimes = v; rm.Repeat = rbRepeat.Checked; this.DialogResult = System.Windows.Forms.DialogResult.OK; } private void rbNormal_CheckedChanged(object sender, EventArgs e) { tbRunTimes.Enabled = rbTest.Checked; } private void rbTest_CheckedChanged(object sender, EventArgs e) { tbRunTimes.Enabled = rbTest.Checked; } } }