private void Reset() { Result rc = Result.OK; QTMessageForm.LaunchForm(this); { EnableButton(ButtonState.ALL, false); Application.DoEvents(); RETRY: //Reset Reader first, it will shutdown current reader and restart reader //It will also reconfig back previous operation if ((rc = Program.ReaderXP.Reconnect(1)) == Result.OK) { int retry = 10; //Start inventory while (Program.ReaderXP.StartOperation(Operation.TAG_RANGING, false) != Result.OK) { if (retry-- == 0) { break; } } } else { if (ShowMsg(String.Format("ResetReader fail rc = {0}. Do you want to try?", rc)) == DialogResult.Yes) { goto RETRY; } } EnableButton(ButtonState.ALL, true); } QTMessageForm.msgform.CloseForm(); }
static void MsgThreadProc() { System.Diagnostics.Debug.WriteLine(String.Format("{0} is threadID {1}", System.Threading.Thread.CurrentThread.Name, System.Threading.Thread.CurrentThread.ManagedThreadId)); msgform = new QTMessageForm(); msgform.StartPosition = FormStartPosition.CenterScreen; msgform.ShowInTaskbar = false; Application.Run(msgform); System.Diagnostics.Debug.WriteLine("ControlPanel Thread is exiting"); }