Exemplo n.º 1
0
        public List <IGeoProvider> Load()
        {
            List <IGeoProvider> list = new List <IGeoProvider>();

            Config.GeoCodingConfigurationSection config = null;

            config = System.Configuration.ConfigurationManager.GetSection(Config.GeoCodingConfigurationSection.SECTION_KEY) as Config.GeoCodingConfigurationSection;
            foreach (var item in config.Providers)
            {
                Config.GeoProviderConfigurationElement element = item as Config.GeoProviderConfigurationElement;
                Type currentType = Type.GetType(element.Type);

                IGeoProvider provider = Activator.CreateInstance(currentType) as IGeoProvider;

                if (provider != null)
                {
                    provider.Key = element.ApiKey;
                    list.Add(provider);
                }
            }

            return(list);
        }
Exemplo n.º 2
0
 public void Remove(GeoProviderConfigurationElement serviceConfig)
 {
     BaseRemove(serviceConfig.Type);
 }
Exemplo n.º 3
0
 public void Add(GeoProviderConfigurationElement serviceConfig)
 {
     BaseAdd(serviceConfig);
 }