コード例 #1
0
        //***************************************************************************
        // Private Methods
        //
        private static void Initialize()
        {
            DynamicMenuProviderConfiguration config =
                (DynamicMenuProviderConfiguration)ConfigurationManager.GetSection("DynamicMenuProvider");

            if (config == null)
            {
                throw new ConfigurationErrorsException("Dynamic menu provider configuration section is not set correctly.");
            }

            _providers = new DynamicMenuProviderCollection();

            System.Web.Configuration.ProvidersHelper.InstantiateProviders(config.Providers, _providers, typeof(DynamicMenuProvider));

            _providers.SetReadOnly();

            _defaultProvider = _providers[config.Default];

            if (_defaultProvider == null)
            {
                throw new ProviderException("No default provider sepecified.");
            }
        }
コード例 #2
0
        //***************************************************************************
        // Private Methods
        // 
        private static void Initialize()
        {
            DynamicMenuProviderConfiguration config =
                (DynamicMenuProviderConfiguration)ConfigurationManager.GetSection("DynamicMenuProvider");

            if (config == null)
                throw new ConfigurationErrorsException("Dynamic menu provider configuration section is not set correctly.");

            _providers = new DynamicMenuProviderCollection();

            System.Web.Configuration.ProvidersHelper.InstantiateProviders(config.Providers, _providers, typeof(DynamicMenuProvider));

            _providers.SetReadOnly();

            _defaultProvider = _providers[config.Default];

            if (_defaultProvider == null)
                throw new ProviderException("No default provider sepecified.");
        }