Beispiel #1
0
 private static void ConfigureEventListener(EventListenerAssemblyAttribute attribute, EventListenerConfig config)
 {
     if (attribute is IgnoreEventListenerAttribute)
     {
         config.Ignore = true;
     }
     else
     {
         config.Ignore = false;
         var addAttribute = (AddEventListenerAttribute)attribute;
         config.Exclude   = addAttribute.Exclude;
         config.Include   = addAttribute.Include;
         config.SkipEvent = addAttribute.ExcludeEvent;
         if (addAttribute.IncludeEvent != null)
         {
             Type[] eventtypes = EventListenerContributor.GetEventTypes(config.ListenerType);
             config.SkipEvent = Array.FindAll(eventtypes, type => Array.IndexOf(addAttribute.IncludeEvent, type) < 0);
         }
         config.Singleton       = addAttribute.Singleton;
         config.ReplaceExisting = addAttribute.ReplaceExisting;
     }
 }
		private static void ConfigureEventListener(EventListenerAssemblyAttribute attribute, EventListenerConfig config)
		{
			if (attribute is IgnoreEventListenerAttribute)
				config.Ignore = true;
			else
			{
				config.Ignore = false;
				var addAttribute = (AddEventListenerAttribute) attribute;
				config.Exclude = addAttribute.Exclude;
				config.Include = addAttribute.Include;
				config.SkipEvent = addAttribute.ExcludeEvent;
				if (addAttribute.IncludeEvent != null)
				{
					Type[] eventtypes = EventListenerContributor.GetEventTypes(config.ListenerType);
					config.SkipEvent = Array.FindAll(eventtypes, type => Array.IndexOf(addAttribute.IncludeEvent, type) < 0);
				}
				config.Singleton = addAttribute.Singleton;
				config.ReplaceExisting = addAttribute.ReplaceExisting;
			}
		}