private void bgWork_DoWork(object sender, DoWorkEventArgs e) { #if DEBUG progressText = "Installing Simple Classic Theme..."; progressWorker.ReportProgress(0); System.Threading.Thread.Sleep(5000); progressWorker.ReportProgress(100); #else SetupHandler.InstallSCT(this); #endif }
private void OpenToolStripMenuItem_Click(object sender, EventArgs e) { if (seOpenFileDialog.ShowDialog() == DialogResult.OK) { setupHandler = new SetupHandler(seOpenFileDialog.FileName, _logger); setup = setupHandler.GetSetup(); seHeaderReadOnlyTextBox.Text = String.Format("car : {0}\ttrack : {1} - {2}\r\nsetup : {3}", setup.SetupSummary.CarName, setup.SetupSummary.TrackName, setup.SetupSummary.TrackCfg, setup.SetupSummary.SetupName); seToolStripStatusLabel.Text = String.Format("Setup File : {0}", setupHandler.GetSetupFileName()); } }
// Setup a SerialPort connection at the given portName and baudrate. // Reopening a port (e.g. to change the baudrate) cannot be performed synchronously. // Raise a callback asynchronously, once the status of the connection is known. public void Setup(string portName, int baudrate, SetupHandler setupCallback = null) { lock (setupRequestsLock) setupRequests.Enqueue(new SetupRequest(new SerialPort(@"\\.\" + portName, baudrate, Parity.None, 8, StopBits.One), setupCallback)); }
public SetupRequest(SerialPort port, SetupHandler setupCallback) { Port = port; SetupCallback = setupCallback; }