Ejemplo n.º 1
0
        public IDictionary <string, Pair <string, ISubscriptionRegistrar> > GetAvailableSubscriptionRegistrars()
        {
            if (registrarDictionary != null)
            {
                return(registrarDictionary);
            }
            var registrars = TypeFinder.InstancesOfType <ISubscriptionRegistrar>();

            registrarDictionary = registrarDictionary ?? new Dictionary <string, Pair <string, ISubscriptionRegistrar> >();
            if (registrars != null && registrars.Any())
            {
                foreach (var r in registrars)
                {
                    var subscriptionTypes = r.GetSubscriptionTypes();
                    foreach (var(key, value) in subscriptionTypes)
                    {
                        registrarDictionary.Add(key, Pair.Create(value, r));
                    }
                }
            }

            return(registrarDictionary);
        }