コード例 #1
0
        public void RegisterEventSink(Type type,
                                      string methodName,
                                      string eventID)
        {
            EventBrokerPolicy policy = GetEventBrokerPolicy(type);

            policy.AddSink(type.GetMethod(methodName), eventID);
        }
コード例 #2
0
        public void RegisterEventSource(Type type,
                                        string eventName,
                                        string eventID)
        {
            EventBrokerPolicy policy = GetEventBrokerPolicy(type);

            policy.AddSource(type.GetEvent(eventName), eventID);
        }
コード例 #3
0
        EventBrokerPolicy GetEventBrokerPolicy(Type type)
        {
            EventBrokerPolicy policy = (EventBrokerPolicy)policies.Get <IEventBrokerPolicy>(type);

            if (policy == null)
            {
                policy = new EventBrokerPolicy();
                policies.Set <IEventBrokerPolicy>(policy, type);
            }

            return(policy);
        }