예제 #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;
 }