public SiteMapBuilder(
            ISiteMapNodeProvider siteMapNodeProvider,
            ISiteMapNodeVisitor siteMapNodeVisitor,
            ISiteMapHierarchyBuilder siteMapHierarchyBuilder,
            ISiteMapNodeHelperFactory siteMapNodeHelperFactory,
            ICultureContextFactory cultureContextFactory
            )
        {
            if (siteMapNodeProvider == null)
                throw new ArgumentNullException("siteMapNodeProvider");
            if (siteMapNodeVisitor == null)
                throw new ArgumentNullException("siteMapNodeVisitor");
            if (siteMapHierarchyBuilder == null)
                throw new ArgumentNullException("siteMapHierarchyBuilder");
            if (siteMapNodeHelperFactory == null)
                throw new ArgumentNullException("siteMapNodeHelperFactory");
            if (cultureContextFactory == null)
                throw new ArgumentNullException("cultureContextFactory");

            this.siteMapNodeProvider = siteMapNodeProvider;
            this.siteMapHierarchyBuilder = siteMapHierarchyBuilder;
            this.siteMapNodeHelperFactory = siteMapNodeHelperFactory;
            this.siteMapNodeVisitor = siteMapNodeVisitor;
            this.cultureContextFactory = cultureContextFactory;
        }
        public SiteMapBuilder(
            ISiteMapNodeProvider siteMapNodeProvider,
            ISiteMapNodeVisitor siteMapNodeVisitor,
            ISiteMapHierarchyBuilder siteMapHierarchyBuilder,
            ISiteMapCacheKeyGenerator siteMapCacheKeyGenerator,
            ISiteMapNodeHelperFactory siteMapNodeHelperFactory
            )
        {
            if (siteMapNodeProvider == null)
                throw new ArgumentNullException("siteMapNodeProvider");
            if (siteMapNodeVisitor == null)
                throw new ArgumentNullException("siteMapNodeVisitor");
            if (siteMapHierarchyBuilder == null)
                throw new ArgumentNullException("siteMapHierarchyBuilder");
            if (siteMapCacheKeyGenerator == null)
                throw new ArgumentNullException("siteMapCacheKeyGenerator");
            if (siteMapNodeHelperFactory == null)
                throw new ArgumentNullException("siteMapNodeHelperFactory");

            this.siteMapNodeProvider = siteMapNodeProvider;
            this.siteMapHierarchyBuilder = siteMapHierarchyBuilder;
            this.siteMapCacheKeyGenerator = siteMapCacheKeyGenerator;
            this.siteMapNodeHelperFactory = siteMapNodeHelperFactory;
            this.siteMapNodeVisitor = siteMapNodeVisitor;
        }
 public SiteMapLoaderContainer(ConfigurationSettings settings)
 {
     // Singleton instances
     if (settings.EnableSiteMapFile)
     {
         this.absoluteFileName = HostingEnvironment.MapPath(settings.SiteMapFileName);
     }
     this.mvcContextFactory = new MvcContextFactory();
     #if NET35
     this.siteMapCache = new SiteMapCache(new AspNetCacheProvider<ISiteMap>(this.mvcContextFactory));
     #else
     this.siteMapCache = new SiteMapCache(new RuntimeCacheProvider<ISiteMap>(System.Runtime.Caching.MemoryCache.Default));
     #endif
     this.cacheDependency = this.ResolveCacheDependency(settings);
     this.requestCache = this.mvcContextFactory.GetRequestCache();
     this.urlPath = new UrlPath(this.mvcContextFactory);
     this.siteMapCacheKeyGenerator = new SiteMapCacheKeyGenerator(this.mvcContextFactory);
     this.siteMapCacheKeyToBuilderSetMapper = new SiteMapCacheKeyToBuilderSetMapper();
     var siteMapNodeFactoryContainer = new SiteMapNodeFactoryContainer(settings, this.mvcContextFactory, this.urlPath);
     this.siteMapNodeToParentRelationFactory = new SiteMapNodeToParentRelationFactory();
     this.nodeKeyGenerator = new NodeKeyGenerator();
     this.siteMapNodeFactory = siteMapNodeFactoryContainer.ResolveSiteMapNodeFactory();
     this.siteMapNodeCreatorFactory = this.ResolveSiteMapNodeCreatorFactory();
     this.dynamicSiteMapNodeBuilderFactory = new DynamicSiteMapNodeBuilderFactory(this.siteMapNodeCreatorFactory);
     this.siteMapHierarchyBuilder = new SiteMapHierarchyBuilder();
     this.siteMapXmlReservedAttributeNameProvider = new SiteMapXmlReservedAttributeNameProvider(settings.AttributesToIgnore);
     this.siteMapNodeHelperFactory = this.ResolveSiteMapNodeHelperFactory();
     this.siteMapNodeVisitor = this.ResolveSiteMapNodeVisitor(settings);
     this.siteMapXmlNameProvider = new SiteMapXmlNameProvider();
     this.attributeAssemblyProviderFactory = new AttributeAssemblyProviderFactory();
     this.mvcSiteMapNodeAttributeDefinitionProvider = new MvcSiteMapNodeAttributeDefinitionProvider();
     this.siteMapNodeProvider = this.ResolveSiteMapNodeProvider(settings);
     this.siteMapBuiderSetStrategy = this.ResolveSiteMapBuilderSetStrategy(settings);
     var siteMapFactoryContainer = new SiteMapFactoryContainer(settings, this.mvcContextFactory, this.urlPath);
     this.siteMapFactory = siteMapFactoryContainer.ResolveSiteMapFactory();
     this.siteMapCreator = new SiteMapCreator(this.siteMapCacheKeyToBuilderSetMapper, this.siteMapBuiderSetStrategy, this.siteMapFactory);
 }