Ejemplo n.º 1
0
        /// <summary>
        /// Gets the SiteMapMenu section settings of the app.config or web.config
        /// </summary>
        public static SiteMapMenuSection GetSiteMapMenuSection(IUrlRewriteController urlRewriteController)
        {
            SiteMapMenuSection section = (SiteMapMenuSection)ConfigurationManager.GetSection(SiteMapMenuControllerFactory.SECTION_NAME);

            section.UrlRewriteController = urlRewriteController;
            return(section);
        }
        /// <summary>
        /// Gets the SiteMapMenu section settings of the app.config
        /// </summary>
        public static ISiteMapMenuController CreateSiteMapMenuController(IUrlRewriteController urlRewriteController)
        {
            SiteMapMenuSection section = (SiteMapMenuSection)ConfigurationManager.GetSection(SECTION_NAME);

            if (!string.IsNullOrEmpty(section.SiteMapMenuControllerProviderType))
            {
                ISiteMapMenuController customController = Activator.CreateInstance(Type.GetType(section.SiteMapMenuControllerProviderType)) as ISiteMapMenuController;
                if (customController != null)
                {
                    return(customController.CreateSiteMapMenuControllerInstance(urlRewriteController));
                }
            }

            return(section);
        }