예제 #1
0
        public static void LoadProviders()
        {
            if (_provider == null)
            {
                lock (_lock)
                {
                    if (_provider == null)
                    {
                        // Get a reference to the <acdService> section
                        CodificationServiceSection section = (CodificationServiceSection)
                                                             WebConfigurationManager.GetSection
                                                                 ("codifService");

                        // Load registered providers and point _provider
                        // to the default provider
                        _providers = new CodificationProviderCollection();
                        ProvidersHelper.InstantiateProviders
                            (section.Providers, _providers,
                            typeof(CodificationProvider));
                        _provider = _providers[section.DefaultProvider];

                        if (_provider == null)
                        {
                            throw new ProviderException
                                      ("Unable to load default CodificationProvider");
                        }
                    }
                }
            }
        }
예제 #2
0
        public static void LoadProviders()
        {
            if (_provider == null)
            {
                lock (_lock)
                {
                    if (_provider == null)
                    {
                        // Get a reference to the <acdService> section
                        CodificationServiceSection section = (CodificationServiceSection)
                            WebConfigurationManager.GetSection
                            ("codifService");

                        // Load registered providers and point _provider
                        // to the default provider
                        _providers = new CodificationProviderCollection();
                        ProvidersHelper.InstantiateProviders
                            (section.Providers, _providers,
                            typeof(CodificationProvider));
                        _provider = _providers[section.DefaultProvider];

                        if (_provider == null)
                            throw new ProviderException
                                ("Unable to load default CodificationProvider");

                    }
                }
            }
        }