UserMsgBox() публичный Метод

public UserMsgBox ( Form owner, MsgBox msgType, MsgBox msgButtons, MsgBox defaultMsgResult, string msg ) : MsgBox.MsgResult
owner System.Windows.Forms.Form
msgType MsgBox
msgButtons MsgBox
defaultMsgResult MsgBox
msg string
Результат MsgBox.MsgResult
Пример #1
0
        public bool NoTagValueFound(string tagName, string xmlFileName, string moduleName)
        {
            string msg = "XML File Read Error\nNo " + tagName + " Found\n" + xmlFileName + "\n";

            if (moduleName != null)
            {
                msg += (moduleName + "\n");
            }
            m_msgBox.UserMsgBox(SharedObjects.MainWin, MsgBox.MsgTypes.Error, msg);
            return(false);
        }
Пример #2
0
        public bool AddQTail(object data)
        {
            qDataMutex.WaitOne();
            bool flag = true;

            try
            {
                syncDataQ.Enqueue(data);
                qDataReadyEvent.Set();
            }
            catch
            {
                msgBox.UserMsgBox(SharedObjects.MainWin, MsgBox.MsgTypes.Error, "AddQTail\nError Adding Element To Queue\n");
            }
            qDataMutex.ReleaseMutex();
            return(flag);
        }
Пример #3
0
        public bool Set(string[] args)
        {
            bool flag = true;

            try
            {
                if (args != null && args.Length > 0)
                {
                    m_args = new string[args.Length];
                    m_args = args;
                }
                else
                {
                    flag = false;
                }
            }
            catch (Exception ex)
            {
                m_msgBox.UserMsgBox(SharedObjects.MainWin, MsgBox.MsgTypes.Error, "Set Problem\n" + ex.Message + "\nCmdLineArgs\n");
                flag = false;
            }
            return(flag);
        }
Пример #4
0
 public bool Load8Bits(ref byte[] data, ref int index, byte bits, ref bool dataErr)
 {
     try
     {
         if (data.Length < index + 1)
         {
             dataErr = true;
             SharedObjects.Log.Write(Logging.MsgType.Debug, "DataUtils", "Load 8 Bits Failed -> Not Enough Destination Data Bytes For Load");
         }
         else
         {
             data[index++] = bits;
         }
     }
     catch (Exception ex)
     {
         dataErr = true;
         if (handleException)
         {
             m_msgBox.UserMsgBox(SharedObjects.MainWin, MsgBox.MsgTypes.Error, "Load 8 Bits Failed\nData Transfer Issue\n" + ex.Message + "\nDataUtils\n");
         }
         else
         {
             throw;
         }
     }
     return(dataErr);
 }
Пример #5
0
        public bool Write(MsgType msgType, string extraInfo, string message)
        {
            bool flag = true;

            if (!CheckLogging(msgType))
            {
                return(flag);
            }
            Logging.m_logMutex.WaitOne();
            try
            {
                string str1 = string.Empty;
                string str2;
                if (!Logging.useHighResTime)
                {
                    str2 = "[" + DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss.fff") + "] ";
                }
                else
                {
                    DateTime dateTime = new DateTime(2001, 1, 1);
                    DateTime now      = DateTime.Now;
                    string   str3     = str1 + "[" + now.ToString("MM/dd/yyyy hh:mm:ss.");
                    long     ticks    = now.Ticks - dateTime.Ticks;
                    TimeSpan timeSpan = new TimeSpan(ticks);
                    long     num      = ticks / 10L - (long)timeSpan.TotalSeconds * 1000000L;
                    str2 = str3 + num.ToString("D6") + "] ";
                }
                string str4 = "<" + GetMsgTypeStr(msgType) + "> ";
                string str5 = message ?? string.Empty;
                string str6 = string.Empty;
                if (!string.IsNullOrEmpty(extraInfo))
                {
                    str6 = " {" + extraInfo + "}";
                }
                string str7 = string.Empty;

                if (Logging.useConsoleLogging && msgType >= Logging.msgConsoleLevel)
                {
                    string str3 = str2 + str4 + str5 + str6 + "\r\n";
                    if (Logging.useCommandLineMode)
                    {
                        str3 = msgType != MsgType.Info ? str4 + str5 + str6 + "\r\n" : str5 + "\r\n";
                    }
                    Console.Write(str3);
                }
                if (Logging.useFileLogging)
                {
                    if (msgType >= Logging.msgFileLevel)
                    {
                        flag = UpdateFileLog(str2 + str4 + str5 + str6 + "\r\n");
                    }
                }
            }
            catch (Exception ex)
            {
                if (Logging.useMsgBox)
                {
                    string msg = "Cannot Write Log Data\n" + ex.Message + "\nLogging\n";
                    m_msgBox.UserMsgBox(SharedObjects.MainWin, MsgBox.MsgTypes.Error, msg);
                }
            }
            Logging.m_logMutex.ReleaseMutex();
            return(flag);
        }