Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MvcSiteMapHtmlHelper"/> class.
        /// </summary>
        /// <param name="htmlHelper">The HTML helper.</param>
        /// <param name="provider">The sitemap.</param>
        public MvcSiteMapHtmlHelper(HtmlHelper htmlHelper, ISiteMap siteMap)
        {
            if (htmlHelper == null)
            {
                throw new ArgumentNullException("htmlHelper");
            }
            if (siteMap == null)
            {
                throw new ArgumentNullException("siteMap");
            }

            MvcSiteMapProviderViewEngine.Register();
            HtmlHelper = htmlHelper;
            SiteMap    = siteMap;
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MvcSiteMapHtmlHelper"/> class.
        /// </summary>
        /// <param name="htmlHelper">The HTML helper.</param>
        /// <param name="siteMap">The sitemap.</param>
        /// <param name="useViewEngine"><c>true</c> to use the internal view engine; otherwise <c>false</c></param>
        internal MvcSiteMapHtmlHelper(HtmlHelper htmlHelper, ISiteMap siteMap, bool useViewEngine)
        {
            if (htmlHelper == null)
            {
                throw new ArgumentNullException("htmlHelper");
            }
            if (siteMap == null)
            {
                throw new ArgumentNullException("siteMap");
            }

            HtmlHelper = htmlHelper;
            SiteMap    = siteMap;

            if (useViewEngine)
            {
                MvcSiteMapProviderViewEngine.Register();
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="MvcSiteMapHtmlHelper"/> class.
 /// </summary>
 /// <param name="htmlHelper">The HTML helper.</param>
 /// <param name="provider">The sitemap provider.</param>
 public MvcSiteMapHtmlHelper(HtmlHelper htmlHelper, SiteMapProvider provider)
 {
     MvcSiteMapProviderViewEngine.Register();
     HtmlHelper = htmlHelper;
     Provider   = provider;
 }