Пример #1
0
        private bool ReadNode_LogString(XmlNode nodeServerInfo, out ushort nID, out LOGSTRING logString)
        {
            nID       = 0;
            logString = new LOGSTRING();

            if (nodeServerInfo.Attributes[ATT_NAME_ID] == null ||
                nodeServerInfo.Attributes[ATT_NAME_NAME] == null ||
                nodeServerInfo.Attributes[ATT_NAME_STRING] == null)
            {
                return(false);
            }

            string strID     = nodeServerInfo.Attributes[ATT_NAME_ID].Value;
            string strName   = nodeServerInfo.Attributes[ATT_NAME_NAME].Value;
            string strString = nodeServerInfo.Attributes[ATT_NAME_STRING].Value;

            if (strID.Length == 0 ||
                strName.Length == 0 ||
                strString.Length == 0)
            {
                return(false);
            }

            if (ushort.TryParse(strID, out nID) == false)
            {
                return(false);
            }
            logString.strName   = strName;
            logString.strString = strString;
            return(true);
        }
Пример #2
0
 public bool GetString(ushort nLogStringID, out string strLogMessage)
 {
     try
     {
         LOGSTRING logString = m_dicStringTable[nLogStringID];
         strLogMessage = logString.strString;
     }
     catch
     {
         strLogMessage = "";
         return(false);
     }
     return(true);
 }