Boolean init(bool ejFront) { if (settings == null) { MessageBox.Show(msgNotInitOptions, Application.ProductName); wdwOptions frmOptions = new wdwOptions(settings); frmOptions.ShowDialog(); return(false); } txtTrack1.Text = settings.track1; chkTrack1.Checked = settings.chkTrack1; txtTrack2.Text = settings.track2; chkTrack2.Checked = settings.chkTrack2; txtTrack3.Text = settings.track3; chkTrack3.Checked = settings.chkTrack3; txtCardsAmount.Value = (settings.wrAmount <= 0) ? 1 : settings.wrAmount; chkFrontEject.Checked = settings.ejFront; chkRearEject.Checked = !settings.ejFront; if (rdr != null) { rdr.close(); } rdr = new KMVF(settings.port, settings.speed); string result = ""; consoleAddLine(msgInit); bool ret = rdr.init(ejFront, ref result); consoleAppendLine(msgResSeparator + result); return(ret); }
private void optToolStripMenuItem_Click(object sender, EventArgs e) { wdwOptions frmOptions = new wdwOptions(settings); frmOptions.ShowDialog(); }
Boolean init(bool ejFront) { if (settings == null) { MessageBox.Show(msgNotInitOptions, Application.ProductName); wdwOptions frmOptions = new wdwOptions(settings); frmOptions.ShowDialog(); return false; } txtTrack1.Text = settings.track1; chkTrack1.Checked = settings.chkTrack1; txtTrack2.Text = settings.track2; chkTrack2.Checked = settings.chkTrack2; txtTrack3.Text = settings.track3; chkTrack3.Checked = settings.chkTrack3; txtCardsAmount.Value = (settings.wrAmount <= 0) ? 1 : settings.wrAmount; chkFrontEject.Checked = settings.ejFront; chkRearEject.Checked = !settings.ejFront; if (rdr != null) rdr.close(); rdr = new KMVF(settings.port, settings.speed); string result = ""; consoleAddLine(msgInit); bool ret = rdr.init(ejFront, ref result); consoleAppendLine(msgResSeparator + result); return ret; }