public void HandleApplicationEvent(object sender, ApplicationEventArgs e)
 {
     if(_eventTypes == null || _eventTypes.Count == 0) {
         SendEventAsMessage(e);
         return;
     }
     foreach(Type type in _eventTypes) {
         if(type.IsAssignableFrom(e.GetType())) {
             SendEventAsMessage(e);
             return;
         }
     }
 }
Ejemplo n.º 2
0
		public void HandleApplicationEvent(object source, ApplicationEventArgs e)
		{
			ContextEventArgs ctxArgs = e as ContextEventArgs;
			if (ctxArgs != null)
			{
				if (ctxArgs.Event == ContextEventArgs.ContextEvent.Refreshed)
				{
					_appListenerContextRefreshed = true;
				}
				if (ctxArgs.Event == ContextEventArgs.ContextEvent.Closed)
				{
					_appListenerContextClosed = true;
				}
			}
		}
Ejemplo n.º 3
0
        private void ContextRefreshedHandler(object sender, ApplicationEventArgs e)
        {
            ContextEventArgs args = e as ContextEventArgs;

            if (args != null)
            {
                if (args.Event == ContextEventArgs.ContextEvent.Refreshed)
                {
                    _ctxRefreshed = true;
                }
                else if (args.Event == ContextEventArgs.ContextEvent.Closed)
                {
                    _ctxClosed = true;
                }
            }
        }
Ejemplo n.º 4
0
        public void HandleApplicationEvent(object source, ApplicationEventArgs e)
        {
            ContextEventArgs ctxArgs = e as ContextEventArgs;

            if (ctxArgs != null)
            {
                if (ctxArgs.Event == ContextEventArgs.ContextEvent.Refreshed)
                {
                    _appListenerContextRefreshed = true;
                }
                if (ctxArgs.Event == ContextEventArgs.ContextEvent.Closed)
                {
                    _appListenerContextClosed = true;
                }
            }
        }
        public void HandleApplicationEvent(object sender, ApplicationEventArgs e)
        {

            

            var eventArgs = e as ContextRefreshedEventArgs;

            if (eventArgs == null) return;

            var args = eventArgs;

            if (args.Event != ContextEventArgs.ContextEvent.Refreshed) return;

            var ctx = (IApplicationContext)sender;
            var eventService = (IEventService)ctx.GetObject("EventService");
            eventService.RegisterEvents();
        }
 public void Destroy()
 {
     _args = null;
 }
 public void Init()
 {
     _args = new ApplicationEventArgs();
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Handles the application context's refresh event and starts the scheduler.
 /// </summary>
 public void HandleApplicationEvent(object sender, ApplicationEventArgs e)
 {
     // auto-start Scheduler if demanded
     if (e is ContextRefreshedEventArgs && autoStartup)
     {
         try
         {
             StartScheduler(scheduler, startupDelay);
         }
         catch (SchedulerException ex)
         {
             throw new ObjectInitializationException("failed to auto-start scheduler", ex);
         }
     }
 }
Ejemplo n.º 9
0
 public void HandleApplicationEvent(object sender, ApplicationEventArgs e)
 {
 }
		public void Destroy()
		{
			_args = null;
		}
		public void Init()
		{
			_args = new ApplicationEventArgs();
		}
Ejemplo n.º 12
0
		private void ContextRefreshedHandler(object sender, ApplicationEventArgs e)
		{
			ContextEventArgs args = e as ContextEventArgs;
			if (args != null)
			{
				if (args.Event == ContextEventArgs.ContextEvent.Refreshed)
				{
					_ctxRefreshed = true;
				}
				else if (args.Event == ContextEventArgs.ContextEvent.Closed)
				{
					_ctxClosed = true;
				}
			}
		}
 public void HandleApplicationEvent(object sender, ApplicationEventArgs e)
 {
     if (_endpoint is IApplicationEventListener) {
         ((IApplicationEventListener) _endpoint).HandleApplicationEvent(sender, e);
     }
 }
 private bool SendEventAsMessage(ApplicationEventArgs @event)
 {
     return SendMessage(MessageBuilder.WithPayload(@event).Build());
 }