Example #1
0
 public static void WaitForDevice()
 {
     while (!Fel.DeviceExists())
     {
         Thread.Sleep(100);
     }
 }
Example #2
0
 private void timer_Tick(object sender, EventArgs e)
 {
     if (Fel.DeviceExists(vid, pid))
     {
         DialogResult  = DialogResult.OK;
         timer.Enabled = false;
     }
 }
Example #3
0
 private void timer_Tick(object sender, EventArgs e)
 {
     if (Fel.DeviceExists())
     {
         DialogResult  = DialogResult.OK;
         timer.Enabled = false;
         deviceFound   = true;
         Close();
     }
 }
Example #4
0
 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);
 }
Example #5
0
        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);
        }
Example #6
0
 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;
         }
     }
 }
Example #7
0
 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;
         }
     }
 }