Пример #1
0
        protected override void OnInitialization()
        {
            base.OnInitialization();
            _automationService.Register();

            EventServiceFactory.EventService.GetEvent <GenericEvent <ActionData> >().Subscribe(x => _automationService.ProcessAction(x.Value.Action.ActionType, x.Value));
            EventServiceFactory.EventService.GetEvent <GenericEvent <Message> >().Subscribe(x =>
            {
                if (x.Topic == EventTopicNames.MessageReceivedEvent && x.Value.Command == "ActionMessage")
                {
                    _applicationState.NotifyEvent(RuleEventNames.MessageReceived, new { Command = x.Value.Data });
                }
            });
        }