public void SendCmdResult(bool result, string cmdName)
{
if (InvokeRequired)
{
try
{
Invoke((Delegate)new AttributesForm.SendCmdResultDelegate(SendCmdResult), result, cmdName);
}
catch { }
}
else
{
if (result)
return;
string msg1 = "Send Command Failed\nMessage Name = " + cmdName + "\n";
if (DisplayMsgCallback != null)
DisplayMsgCallback(SharedAppObjs.MsgType.Error, msg1);
msgBox.UserMsgBox((Form)this, MsgBox.MsgTypes.Error, msg1);
int qlength = devForm.threadMgr.txDataOut.dataQ.GetQLength();
if (qlength > 0)
{
string msg2 = "There Are " + qlength.ToString() + " Pending Transmit Messages\nDo You Want To Clear All Pending Transmit Messages?\n";
if (DisplayMsgCallback != null)
DisplayMsgCallback(SharedAppObjs.MsgType.Warning, msg2);
MsgBox.MsgResult msgResult = msgBox.UserMsgBox(SharedObjects.MainWin, MsgBox.MsgTypes.Warning, MsgBox.MsgButtons.YesNo, MsgBox.MsgResult.Yes, msg2);
string msg3 = "UserResponse = " + ((object)msgResult).ToString() + "\n";
if (DisplayMsgCallback != null)
DisplayMsgCallback(SharedAppObjs.MsgType.Info, msg3);
if (msgResult == MsgBox.MsgResult.Yes)
devForm.threadMgr.txDataOut.dataQ.ClearQ();
}
RestoreFormInput();
}
}