Ejemplo n.º 1
0
        /// <summary>
        /// Updates the log in server.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="Logging.Modal.MessageRecievedEventArgs"/> instance containing the event data.</param>
        private void UpdateLogInServer(object sender, Logging.Modal.MessageRecievedEventArgs e)
        {
            LogMessageRecord record = new LogMessageRecord(e.Message, e.Status);
            CommandMessage   cmd    = new CommandMessage(CommandEnum.LogCommand, new string[] { record.ToJSON() });

            ServerCommunication.Instance.Send(cmd.ToJSON());
        }
Ejemplo n.º 2
0
        /* operation triggered by message is writing it to the event log */
        private void NewLogMessage(object sender, Logging.Modal.MessageRecievedEventArgs e)
        {
            EventLogEntryType stat;

            switch (e.Status)
            {
            case MessageTypeEnum.INFO:
                stat = EventLogEntryType.Information;
                break;

            case MessageTypeEnum.WARNING:
                stat = EventLogEntryType.Warning;
                break;

            case MessageTypeEnum.FAIL:
                stat = EventLogEntryType.FailureAudit;
                break;

            default:
                stat = EventLogEntryType.Information;
                break;
            }
            IS_eventLogger.WriteEntry(e.Message, stat);
        }
Ejemplo n.º 3
0
        public void addLog(object source, Logging.Modal.MessageRecievedEventArgs e)
        {
            Log l = new Log(e.Status.ToString(), e.Message);

            this.logs.Add(l);
        }
Ejemplo n.º 4
0
 protected void OnMessageRecieved(object sender, Logging.Modal.MessageRecievedEventArgs e)
 {
     eventLog1.WriteEntry(e.Message, mapping[e.Status]);     // Adding the Log To the entry
 }