public void AddLifeCycleManager(IQHsmLifeCycleManagerEvents managerEvents)
        {
            managerEvents.LifeCycleChange += new QHsmLifeCycleChangeHandler(managerEvents_LifeCycleChange);
            IQHsmEvents events = managerEvents as IQHsmEvents;
            events.StateChange += new EventHandler(events_StateChange);
            events.UnhandledTransition += new DispatchUnhandledTransitionHandler(events_UnhandledTransition);
            events.DispatchException += new DispatchExceptionHandler(events_DispatchException);

            IQEventManagerEvents eventManagerEvents = managerEvents as IQEventManagerEvents;
            if(null != eventManagerEvents)
            {
                eventManagerEvents.PolledEvent += new PolledEventHandler(eventManagerEvents_PolledEvent);
                eventManagerEvents.EMDispatchException += new EventManagerDispatchExceptionHandler(eventManagerEvents_EMDispatchException);
                eventManagerEvents.EMDispatchCommandException += new EventManagerDispatchCommandExceptionHandler(eventManagerEvents_EMDispatchCommandException);
            }
        }
예제 #2
0
        public void AddLifeCycleManager(IQHsmLifeCycleManagerEvents managerEvents)
        {
            managerEvents.LifeCycleChange += new QHsmLifeCycleChangeHandler(managerEvents_LifeCycleChange);
            IQHsmEvents events = managerEvents as IQHsmEvents;

            events.StateChange         += new EventHandler(events_StateChange);
            events.UnhandledTransition += new DispatchUnhandledTransitionHandler(events_UnhandledTransition);
            events.DispatchException   += new DispatchExceptionHandler(events_DispatchException);

            IQEventManagerEvents eventManagerEvents = managerEvents as IQEventManagerEvents;

            if (null != eventManagerEvents)
            {
                eventManagerEvents.PolledEvent                += new PolledEventHandler(eventManagerEvents_PolledEvent);
                eventManagerEvents.EMDispatchException        += new EventManagerDispatchExceptionHandler(eventManagerEvents_EMDispatchException);
                eventManagerEvents.EMDispatchCommandException += new EventManagerDispatchCommandExceptionHandler(eventManagerEvents_EMDispatchCommandException);
            }
        }