public void RegisterEventSink(Type type, string methodName, string eventID) { EventBrokerPolicy policy = GetEventBrokerPolicy(type); policy.AddSink(type.GetMethod(methodName), eventID); }
public void RegisterEventSource(Type type, string eventName, string eventID) { EventBrokerPolicy policy = GetEventBrokerPolicy(type); policy.AddSource(type.GetEvent(eventName), eventID); }
EventBrokerPolicy GetEventBrokerPolicy(Type type) { EventBrokerPolicy policy = (EventBrokerPolicy)policies.Get <IEventBrokerPolicy>(type); if (policy == null) { policy = new EventBrokerPolicy(); policies.Set <IEventBrokerPolicy>(policy, type); } return(policy); }