private void myButton3_Click(object sender, EventArgs e) { formProgressReporter = CreateIProgressReporterDialogue("Converting Data"); formProgressReporter.DoWork += ConvertData; formProgressReporter.UpdateProgressAndStatus(-1, "..."); formProgressReporter.RunBackgroundOperationAsync(); formProgressReporter.Dispose(); }
private void UpdateFWList() { pdr = new ProgressReporterDialogue(); pdr.DoWork -= pdr_DoWork; pdr.DoWork += pdr_DoWork; ThemeManager.ApplyThemeTo(pdr); pdr.RunBackgroundOperationAsync(); pdr.Dispose(); }
private void UpdateFWList() { pdr = new ProgressReporterDialogue(); pdr.DoWork -= pdr_DoWork; pdr.doWorkArgs.ForceExit = true; pdr.doWorkArgs.CancelRequestChanged += (sender, args) => { pdr.doWorkArgs.CancelAcknowledged = true; }; pdr.DoWork += pdr_DoWork; ThemeManager.ApplyThemeTo(pdr); pdr.RunBackgroundOperationAsync(); pdr.Dispose(); }
void doUI(string inputfn, string outputfn, bool showui = true) { this.inputfn = inputfn; this.outputfn = outputfn; prd = new ProgressReporterDialogue(); prd.DoWork += prd_DoWork; prd.UpdateProgressAndStatus(-1, Strings.Converting_bin_to_log); this.convertstatus += BinaryLog_convertstatus; ThemeManager.ApplyThemeTo(prd); prd.RunBackgroundOperationAsync(); prd.Dispose(); }
public void Open(bool skipconnectedcheck = false) { if (BaseStream.IsOpen && !skipconnectedcheck) { return; } //MAVlist.Clear(); frmProgressReporter = new ProgressReporterDialogue { StartPosition = FormStartPosition.CenterScreen, Text = "Connecting..." }; frmProgressReporter.DoWork += FrmProgressReporterDoWorkNOParams; frmProgressReporter.UpdateProgressAndStatus(-1, "Connecting..."); //ThemeManager.ApplyThemeTo(frmProgressReporter); frmProgressReporter.RunBackgroundOperationAsync(); frmProgressReporter.Dispose(); }
public int WizardValidate() { comport = CMB_port.Text; if (comport == "") { CustomMessageBox.Show(Strings.SelectComport, Strings.ERROR); return(0); } // ensure we are using a comport if (!(MainV2.comPort.BaseStream is SerialPort)) { MainV2.comPort.BaseStream = new SerialPort(); } if (!fwdone) { pdr = new ProgressReporterDialogue(); pdr.DoWork += pdr_DoWork; ThemeManager.ApplyThemeTo(pdr); pdr.RunBackgroundOperationAsync(); if (pdr.doWorkArgs.CancelRequested || !string.IsNullOrEmpty(pdr.doWorkArgs.ErrorMessage)) { return(0); } pdr.Dispose(); } if (MainV2.comPort.BaseStream.IsOpen) { MainV2.comPort.BaseStream.Close(); } // setup for over usb MainV2.comPort.BaseStream.BaudRate = 115200; MainV2.comPort.BaseStream.PortName = comport; MainV2.comPort.Open(true); // try again if (!MainV2.comPort.BaseStream.IsOpen) { CustomMessageBox.Show("Error connecting. Please unplug, plug back in, wait 10 seconds, and click OK", "Try Again"); MainV2.comPort.Open(true); } if (!MainV2.comPort.BaseStream.IsOpen) { return(0); } if (string.IsNullOrEmpty(pdr.doWorkArgs.ErrorMessage)) { if (Wizard.config.ContainsKey("fwtype") && Wizard.config.ContainsKey("fwframe")) { if (Wizard.config["fwtype"].ToString() == "copter" && Wizard.config["fwframe"].ToString() == "tri") { // check if its a tri, and skip the frame type screen return(2); } } if (Wizard.config.ContainsKey("fwtype") && Wizard.config["fwtype"].ToString() == "copter") { // check if its a quad, and show the frame type screen return(1); } if (Wizard.config.ContainsKey("fwtype") && Wizard.config["fwtype"].ToString() == "rover") { // check if its a rover, and show the compass cal screen - skip accel return(3); } else { // skip the frame type screen as its not valid for anythine else return(2); } } return(0); }