Beispiel #1
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine("----------------");
            sb.AppendFormat("Message ID: {0}  @ {1}\n", MessageID, Timestamp);

            foreach (MessageLine msgLine in msgLineCollection)
            {
                sb.AppendFormat("Raw chatline data: {0}\n", msgLine.OriginalText);
            }

            sb.AppendFormat("Message Code: {0:x}\n", MessageCode);

            sb.AppendFormat("Message Category: {0}\n", MessageCategory);
            sb.AppendFormat("Parse Successful: {0}\n", IsParseSuccessful);

            if (SystemDetails != null)
            {
                sb.Append(SystemDetails.ToString());
            }
            if (ChatDetails != null)
            {
                sb.Append(ChatDetails.ToString());
            }
            if (EventDetails != null)
            {
                sb.Append(EventDetails.ToString());
            }

            sb.Append("\n");

            return(sb.ToString());
        }
Beispiel #2
0
        internal void SetMessageCategory(MessageCategoryType _messageCategory)
        {
            switch (_messageCategory)
            {
            case MessageCategoryType.Chat:
                ChatDetails = new ChatDetails();
                break;

            case MessageCategoryType.System:
                SystemDetails = new SystemDetails();
                break;

            case MessageCategoryType.Event:
                EventDetails = new EventDetails();
                break;

            default:
                throw new ArgumentOutOfRangeException("_messageCategory", _messageCategory,
                                                      "Unknown message category.");
            }

            messageCategory = _messageCategory;
        }