Ejemplo n.º 1
0
 /// <summary>
 /// When we get invoked from the logger we do this - writes entry into the service.
 /// </summary>
 /// <param name="sender">Who called the event</param>
 /// <param name="e">Aruments of message recieved which contain status and message</param>
 private void OnMsg(object sender, MessageRecievedEventArgs e)
 {
     //This is another event id so i increase it
     this.eventId++;
     //After get invoking from the logging service we will write to the logger
     eventLog1.WriteEntry(e.Message + "\n\nWith status: " + e.Status, EventLogEntryType.Information, this.eventId);
     Console.WriteLine("Log: " + e.Message + "With status: " + e.Status);
     //Adding the log to the log collection
     logs.AddLog(new Log((int)e.Status, e.Message));
 }