Castle.ActiveRecord.EventListenerContributor.Get C# (CSharp) Метод

Get() публичный Метод

Returns the listener config for a specified listener type.
public Get ( Type listenerType ) : EventListenerConfig
listenerType System.Type the type to look for
Результат EventListenerConfig
        public EventListenerConfig Get(Type listenerType)
        {
            if (listenerType == null) throw new ArgumentNullException("listenerType");
            return (listeners.ContainsKey(listenerType)) ?
                                                         	listeners[listenerType] :
                                                         	                        	null;
        }

Usage Example

Пример #1
0
 private static void ProcessEventListenerAssemblyAttributes(EventListenerContributor contributor, IEnumerable <EventListenerAssemblyAttribute> attributes)
 {
     foreach (var attribute in attributes)
     {
         if (attribute.Assembly != null)
         {
             foreach (var type in GetExportedTypesFromAssembly(attribute.Assembly))
             {
                 if (EventListenerContributor.GetEventTypes(type).Length > 0)
                 {
                     var config = contributor.Get(type) ?? contributor.Add(new EventListenerConfig(type));
                     ConfigureEventListener(attribute, config);
                 }
             }
         }
         if (attribute.Type != null)
         {
             var config = contributor.Get(attribute.Type) ?? contributor.Add(new EventListenerConfig(attribute.Type));
             ConfigureEventListener(attribute, config);
         }
     }
 }