public XmlSiteMapResultFactoryContainer(ConfigurationSettings settings)
        {
            var siteMapLoaderContainer = new SiteMapLoaderContainer(settings);

            this.siteMapLoader = siteMapLoaderContainer.ResolveSiteMapLoader();
            this.urlPath       = new UrlPath(new MvcContextFactory());
        }
 public XmlSiteMapResultFactoryContainer(ConfigurationSettings settings)
 {
     var siteMapLoaderContainer = new SiteMapLoaderContainer(settings);
     this.siteMapLoader = siteMapLoaderContainer.ResolveSiteMapLoader();
     this.mvcContextFactory = new MvcContextFactory();
     this.bindingFactory = new BindingFactory();
     this.bindingProvider = new BindingProvider(this.bindingFactory, this.mvcContextFactory);
     this.urlPath = new UrlPath(this.mvcContextFactory, this.bindingProvider);
     this.cultureContextFactory = new CultureContextFactory();
 }
        public XmlSiteMapResultFactoryContainer(ConfigurationSettings settings)
        {
            var siteMapLoaderContainer = new SiteMapLoaderContainer(settings);

            this.siteMapLoader         = siteMapLoaderContainer.ResolveSiteMapLoader();
            this.mvcContextFactory     = new MvcContextFactory();
            this.bindingFactory        = new BindingFactory();
            this.bindingProvider       = new BindingProvider(this.bindingFactory, this.mvcContextFactory);
            this.urlPath               = new UrlPath(this.mvcContextFactory, this.bindingProvider);
            this.cultureContextFactory = new CultureContextFactory();
        }
Example #4
0
        public static void Compose()
        {
#if !MVC2
            // Register global namespaces with Razor so we don't have to import them in Web.config
            WebPageRazorHost.AddGlobalImport("MvcSiteMapProvider.Web.Html");
            WebPageRazorHost.AddGlobalImport("MvcSiteMapProvider.Web.Html.Models");
#endif

            // Get the configuration settings
            var settings = new ConfigurationSettings();

            // If the config specifies to use an external DI container, skip the internal container.
            if (!settings.UseExternalDIContainer)
            {
                if (settings.EnableSiteMapFile)
                {
                    // Validate the Xml File.
                    var validator = new SiteMapXmlValidator();
                    validator.ValidateXml(HostingEnvironment.MapPath(settings.SiteMapFileName));
                }

#if !MVC2
                // If not using a custom DependencyResolver, we prefer to use IControllerFactory
                if (DependencyResolver.Current.GetType().FullName.Equals("System.Web.Mvc.DependencyResolver+DefaultDependencyResolver"))
                {
#endif
                // Setup the Controller Factory with a decorator that can resolve the internal controllers
                var currentFactory = ControllerBuilder.Current.GetControllerFactory();
                ControllerBuilder.Current.SetControllerFactory(
                    new ControllerFactoryDecorator(currentFactory, settings));
#if !MVC2
            }
            else
            {
                // If using a custom IDependencyResolver, decorate it with our IDependencyResolver so we can resolve
                // our internal controller.
                var currentResolver = DependencyResolver.Current;
                DependencyResolver.SetResolver(new DependencyResolverDecorator(currentResolver, settings));
            }
#endif

                // Set the static loader instance
                var siteMapLoaderContainer = new SiteMapLoaderContainer(settings);
                SiteMaps.Loader = siteMapLoaderContainer.ResolveSiteMapLoader();

                if (settings.EnableSitemapsXml)
                {
                    // Register the route for SiteMaps XML
                    XmlSiteMapController.RegisterRoutes(RouteTable.Routes);
                }
            }
        }
Example #5
0
        public static void Compose()
        {
#if !MVC2
            // Register global namespaces with Razor so we don't have to import them in Web.config
            WebPageRazorHost.AddGlobalImport("MvcSiteMapProvider.Web.Html");
            WebPageRazorHost.AddGlobalImport("MvcSiteMapProvider.Web.Html.Models");
#endif

            // Get the configuration settings
            var settings = new ConfigurationSettings();

            // If the config specifies to use an external DI container, skip the internal container.
            if (!settings.UseExternalDIContainer)
            {
                if (settings.EnableSiteMapFile)
                {
                    // Validate the Xml File.
                    var validator = new SiteMapXmlValidator();
                    validator.ValidateXml(HostingEnvironment.MapPath(settings.SiteMapFileName));
                }

#if !MVC2
                // If not using a custom DependencyResolver, we prefer to use IControllerFactory
                if (DependencyResolver.Current.GetType().FullName.Equals("System.Web.Mvc.DependencyResolver+DefaultDependencyResolver"))
                {
#endif
                    // Setup the Controller Factory with a decorator that can resolve the internal controllers
                    var currentFactory = ControllerBuilder.Current.GetControllerFactory();
                    ControllerBuilder.Current.SetControllerFactory(
                        new ControllerFactoryDecorator(currentFactory, settings));
#if !MVC2
                }
                else
                {
                    // If using a custom IDependencyResolver, decorate it with our IDependencyResolver so we can resolve
                    // our internal controller.
                    var currentResolver = DependencyResolver.Current;
                    DependencyResolver.SetResolver(new DependencyResolverDecorator(currentResolver, settings));
                }
#endif

                // Set the static loader instance
                var siteMapLoaderContainer = new SiteMapLoaderContainer(settings);
                SiteMaps.Loader = siteMapLoaderContainer.ResolveSiteMapLoader();

                if (settings.EnableSitemapsXml)
                {
                    // Register the route for SiteMaps XML
                    XmlSiteMapController.RegisterRoutes(RouteTable.Routes);
                }
            }
        }
 public XmlSiteMapResultFactoryContainer(ConfigurationSettings settings)
 {
     var siteMapLoaderContainer = new SiteMapLoaderContainer(settings);
     this.siteMapLoader = siteMapLoaderContainer.ResolveSiteMapLoader();
     this.urlPath = new UrlPath(new MvcContextFactory());
 }