Exemplo n.º 1
0
        public override void Notify(params object[] args)
        {
            foreach (LogEventSubscriber <LogEvents> observors in ObservorList)
            {
                LogEvents eventObj = null;
                if ((LogEventType)args[0] == LogEventType.ThresholdBreachRecoveryCheckEvent)
                {
                    eventObj = new LogThresholdBreachRecoveryCheckEvent();
                    eventObj.ExecutionContext = JobParams;
                }
                if ((LogEventType)args[0] == LogEventType.ThresholdBreachCheckEvent)
                {
                    eventObj = new LogThresholdBreachCheckEvent();
                    eventObj.ExecutionContext = JobParams;
                }
                if ((LogEventType)args[0] == LogEventType.ThresholdBreachDetectedEvent)
                {
                    eventObj = new LogThresholdBreachDetectedEvent();
                    eventObj.ExecutionContext = args[1];
                }
                if ((LogEventType)args[0] == LogEventType.ThresholdBreachRecoveredEvent)
                {
                    eventObj = new LogThresholdBreachRecoveredEvent();
                    eventObj.ExecutionContext = args[1];
                }

                observors.Update(eventObj);
            }
        }
Exemplo n.º 2
0
        public override void Notify(params object[] args)
        {
            LogEvents eventData = null;

            if ((LogEventType)args[0] == LogEventType.LogReportGeneratedEvent)
            {
                eventData = new LogTimeReportGeneratedEvent();
                eventData.ExecutionContext = args[1];
            }
            if ((LogEventType)args[0] == LogEventType.ThresholdBreachDetectedEvent)
            {
                eventData = new LogThresholdBreachDetectedEvent();
                eventData.ExecutionContext = args[1];
            }
            if ((LogEventType)args[0] == LogEventType.ThresholdBreachRecoveredEvent)
            {
                eventData = new LogThresholdBreachRecoveredEvent();
                eventData.ExecutionContext = args[1];
            }

            foreach (LogEventSubscriber <LogEvents> observors in ObservorList)
            {
                observors.Update(eventData);
            }
        }