private static void Initialize()
        {
            MCProviderConfiguration configuration = (MCProviderConfiguration)ConfigurationManager.GetSection("MCProvider");

            if (configuration == null) throw new ConfigurationErrorsException("MCProvider section is missing");

            providers = new MCProviderCollection();

            ProvidersHelper.InstantiateProviders(configuration.Providers, providers, typeof(MCProvider));

            providers.SetReadOnly();

            defaultProvider = providers[configuration.Default];
            if (defaultProvider == null) throw new Exception("defaultProvider");
        }
Example #2
0
        private static void Initialize()
        {
            MCProviderConfiguration configuration = (MCProviderConfiguration)ConfigurationManager.GetSection("MCProvider");

            if (configuration == null)
            {
                throw new ConfigurationErrorsException("MCProvider section is missing");
            }

            providers = new MCProviderCollection();

            ProvidersHelper.InstantiateProviders(configuration.Providers, providers, typeof(MCProvider));

            providers.SetReadOnly();

            defaultProvider = providers[configuration.Default];
            if (defaultProvider == null)
            {
                throw new Exception("defaultProvider");
            }
        }