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