} // proc Dispose #endregion #region -- ExecuteLoop ------------------------------------------------------------ public void ExecuteEvent(DEServerEvent eventType) { lock (actions) { var eventActions = actions.OfType <EventItem>().Where(c => c.EventType == eventType).ToArray(); foreach (var action in eventActions) { try { action.Execute(); } catch (Exception e) { Log.Except(e); } } } } // proc Shutdown
void IDEServerQueue.RegisterEvent(Action action, DEServerEvent eventType) => InsertAction(new EventItem(GetNextId(), action, eventType));
public EventItem(int id, Action action, DEServerEvent eventType) : base(id, action) { this.EventType = eventType; } // ctor