private static void LoadProviders() { if (_provider == null) { lock (_lock) { if (_provider == null) { UserExtProviderSection section = (UserExtProviderSection)ConfigurationManager.GetSection("UserExtProvider"); if (section == null) { throw new ConfigurationErrorsException("在配置文件中没找到“MenuProvider”节点"); } _providers = new UserExtProviderCollection(); ProvidersHelper.InstantiateProviders(section.Providers, _providers, typeof(UserExtProvider)); _provider = _providers[section.DefaultProvider]; if (_provider == null) { throw new ProviderException ("没有找到对应的 MenuProvider"); } } } } }
private static void LoadProviders() { if (_provider == null) { lock (_lock) { if (_provider == null) { UserExtProviderSection section = (UserExtProviderSection)ConfigurationManager.GetSection("UserExtProvider"); if (section == null) throw new ConfigurationErrorsException("�������ļ���û�ҵ���MenuProvider���ڵ�"); _providers = new UserExtProviderCollection(); ProvidersHelper.InstantiateProviders(section.Providers, _providers, typeof(UserExtProvider)); _provider = _providers[section.DefaultProvider]; if (_provider == null) throw new ProviderException ("û���ҵ���Ӧ�� MenuProvider"); } } } }