Пример #1
0
        public void Event(string name, string content, EventType eventType)
        {
            // log event
            var eventItem = new EventItem
            {
                Name        = name,
                Content     = content,
                EventType   = eventType,
                TimeCreated = DateTime.Now
            };

            _events.Push(eventItem);

            // queue overflow
            if (_events.Count > EVENT_LOG_SIZE)
            {
                // remove last item
                _events.Pop();
            }

            // raise event
            _RaiseOnEventOccured(eventItem);
        }
Пример #2
0
 private void _RaiseOnEventOccured(EventItem item)
 => EventOccured?.Invoke(this, new EventOccuredEventArgs(item));
Пример #3
0
 public EventOccuredEventArgs(EventItem item)
 {
     Event = item;
 }