Beispiel #1
0
 /// <summary>
 /// Remove Event Listener
 /// Removes an event listener to specific KIX events of type.
 /// </summary>
 /// <param name="evtType">KIXEventType</param>
 /// <param name="method">Action<KIXEvent></param>
 public void RemoveEventListener(KIXEventType evtType, Action <KIXEvent> method)
 {
     listeners_[evtType.ToString()]?.Remove(method);
     if (listeners_[evtType.ToString()].Count == 0)
     {
         listeners_.Remove(evtType.ToString());
     }
 }
Beispiel #2
0
 /// <summary>
 /// Add Event Listener
 /// Adds an event listener to specific KIX events of type.
 /// </summary>
 /// <param name="evtType">KIXEventType</param>
 /// <param name="method">Action<KIXEvent></param>
 public void AddEventListener(KIXEventType evtType, Action <KIXEvent> method)
 {
     if (!listeners_.ContainsKey(evtType.ToString()))
     {
         listeners_[evtType.ToString()] = new List <Action <KIXEvent> >();
     }
     listeners_[evtType.ToString()].Add(method);
 }