コード例 #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
ファイル: Logs.cs プロジェクト: giladmadmon/image_ex3
        /// <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 { }
        }