public static List <Type> GetSubscriberTypes( IGlobalSubscriber globalSubscriber) { Type type = globalSubscriber.GetType(); if (s_CashedSubscriberTypes.ContainsKey(type)) { return(s_CashedSubscriberTypes[type]); } List <Type> subscriberTypes = type .GetInterfaces() .Where(t => t.GetInterfaces() .Contains(typeof(IGlobalSubscriber))) .ToList(); s_CashedSubscriberTypes[type] = subscriberTypes; return(subscriberTypes); }
public static List <Type> GetImplementedGlobalSubscribers(IGlobalSubscriber globalSubscriber) { return(globalSubscriber.GetType().GetInterfaces() .Where(type => type.GetInterfaces().Contains(typeof(IGlobalSubscriber))) .ToList()); }