예제 #1
0
        /// <summary>
        /// Adds the logs to the logs list.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="Communication.Model.Event.DataReceivedEventArgs"/> instance containing the event data.</param>
        private void AddLogs(object sender, Communication.Model.Event.DataReceivedEventArgs e)
        {
            try {
                CommandMessage cmdMsg = CommandMessage.FromJSON(e.Data);

                if (cmdMsg.CmdId == CommandEnum.LogCommand)
                {
                    foreach (string logMsg in cmdMsg.Args)
                    {
                        this.LogMessages.Add(LogMessageRecord.FromJSON(logMsg));
                    }
                }
            } catch { }
        }
예제 #2
0
        /// <summary>
        /// Adds the logs to the logs list.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="Communication.Model.Event.DataReceivedEventArgs" /> instance containing the event data.</param>
        private void AddLogs(object sender, Communication.Model.Event.DataReceivedEventArgs e)
        {
            try {
                CommandMessage cmdMsg = CommandMessage.FromJSON(e.Data);

                if (cmdMsg.CmdId == CommandEnum.LogCommand)
                {
                    foreach (string logMsg in cmdMsg.Args)
                    {
                        LogMessageRecord msgRcrd = LogMessageRecord.FromJSON(logMsg);
                        if (m_typeFilter == null || msgRcrd.Type.ToString().Equals(m_typeFilter))
                        {
                            this.LogMessages.Add(new LogMessageRecord(msgRcrd.Message, msgRcrd.Type));
                        }
                    }

                    ClientCommunication.Instance.OnDataRecieved -= AddLogs;
                    finishedGettingLogs = true;
                }
            } catch { }
        }