Пример #1
0
 private static void ExecuteHandlers(List <Action <EventArg> > evenHandlers, EventArg parameter)
 {
     foreach (var action in evenHandlers)
     {
         action(parameter);
     }
 }
Пример #2
0
 public static void PublishEvent(string eventName, EventArg parameter)
 {
     if (dic.ContainsKey(eventName))
     {
         ExecuteHandlers(dic[eventName], parameter);
     }
 }