public static void WaitForDevice() { while (!Fel.DeviceExists()) { Thread.Sleep(100); } }
private void timer_Tick(object sender, EventArgs e) { if (Fel.DeviceExists(vid, pid)) { DialogResult = DialogResult.OK; timer.Enabled = false; } }
private void timer_Tick(object sender, EventArgs e) { if (Fel.DeviceExists()) { DialogResult = DialogResult.OK; timer.Enabled = false; deviceFound = true; Close(); } }
public static bool WaitForDevice(UInt16 vid, UInt16 pid) { if (!Fel.DeviceExists(vid, pid)) { var form = new WaitingForm(vid, pid); form.ShowDialog(); return(form.DialogResult == DialogResult.OK); } return(true); }
public static bool WaitForDevice(UInt16 vid, UInt16 pid, IWin32Window owner) { if (Fel.DeviceExists(vid, pid)) { return(true); } var form = new WaitingFelForm(vid, pid); form.ShowDialog(owner); return(form.DialogResult == DialogResult.OK); }
private void WaitingForm_FormClosing(object sender, FormClosingEventArgs e) { if (!Fel.DeviceExists(vid, pid)) { if (Tasks.MessageForm.Show(Resources.AreYouSure, Resources.DoYouWantCancel, Resources.sign_warning, new Tasks.MessageForm.Button[] { Tasks.MessageForm.Button.Yes, Tasks.MessageForm.Button.No }, Tasks.MessageForm.DefaultButton.Button2) == Tasks.MessageForm.Button.No) { e.Cancel = true; } else { DialogResult = DialogResult.Abort; } } }
private void WaitingForm_FormClosing(object sender, FormClosingEventArgs e) { if (!Fel.DeviceExists(vid, pid)) { if (MessageBox.Show(this, Resources.DoYouWantCancel, Resources.AreYouSure, MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.No) { e.Cancel = true; } else { DialogResult = DialogResult.Abort; } } }