Esempio n. 1
0
        private static void tickTimer_Tick(object sender, EventArgs e)
        {
            if (_messageQueue.HasMessages)
            {
                var messages = _messageQueue.Dequeue();

                foreach (var message in messages)
                {
                    var logEvent = new LogEvent(message, RootContext, Levels);

                    if (logEvent.IsControlMessage)
                    {
                        var handled = false;

                        if (logEvent.Message.ToLower().Contains("events"))
                        {
                            handled = true;
                            LogEvents.Clear();
                        }

                        if (logEvent.Message.ToLower().Contains("reset"))
                        {
                            handled = true;
                            ClearAll();
                        }

                        if (!handled)
                        {
                            LogEvents.Add(logEvent);
                        }
                    }
                    else
                    {
                        LogEvents.Add(logEvent);
                    }
                }

                OnChanged();
            }
        }
Esempio n. 2
0
 public void Add(LogEvent logEvent)
 {
     events.Add(logEvent, true);
 }