123456789101112131415161718192021222324 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace GUI.GUIUtils
- {
- public class EventPerformer<ListenerType> : LinkedList<ListenerType> where ListenerType : class
- {
- public void AddSafe(ListenerType listener)
- {
- AddFirst(listener);
- }
- public void Perform(Action<ListenerType> performFunc)
- {
- foreach (var it in this)
- {
- performFunc?.Invoke(it);
- }
- }
- }
- }
|