Ejemplo n.º 1
0
        public SiteMap(
            ISiteMapPluginProvider pluginProvider,
            IMvcContextFactory mvcContextFactory,
            ISiteMapChildStateFactory siteMapChildStateFactory,
            IUrlPath urlPath,
            ISiteMapSettings siteMapSettings
            )
        {
            if (pluginProvider == null)
                throw new ArgumentNullException("pluginProvider");
            if (mvcContextFactory == null)
                throw new ArgumentNullException("mvcContextFactory");
            if (siteMapChildStateFactory == null)
                throw new ArgumentNullException("siteMapChildStateFactory");
            if (urlPath == null)
                throw new ArgumentNullException("urlPath");
            if (siteMapSettings == null)
                throw new ArgumentNullException("siteMapSettings");

            this.pluginProvider = pluginProvider;
            this.mvcContextFactory = mvcContextFactory;
            this.siteMapChildStateFactory = siteMapChildStateFactory;
            this.urlPath = urlPath;
            this.siteMapSettings = siteMapSettings;

            // Initialize dictionaries
            this.childNodeCollectionTable = siteMapChildStateFactory.CreateChildNodeCollectionDictionary();
            this.keyTable = siteMapChildStateFactory.CreateKeyDictionary();
            this.parentNodeTable = siteMapChildStateFactory.CreateParentNodeDictionary();
            this.urlTable = siteMapChildStateFactory.CreateUrlDictionary();
        }
Ejemplo n.º 2
0
 public LockableSiteMap(
     ISiteMapPluginProvider pluginProvider,
     IMvcContextFactory mvcContextFactory,
     ISiteMapChildStateFactory siteMapChildStateFactory,
     IUrlPath urlPath,
     ISiteMapSettings siteMapSettings
     )
     : base(pluginProvider, mvcContextFactory, siteMapChildStateFactory, urlPath, siteMapSettings)
 {
 }
Ejemplo n.º 3
0
 public LockableSiteMap(
     ISiteMapPluginProvider pluginProvider,
     IMvcContextFactory mvcContextFactory,
     ISiteMapChildStateFactory siteMapChildStateFactory,
     IUrlPath urlPath,
     ISiteMapSettings siteMapSettings
     )
     : base(pluginProvider, mvcContextFactory, siteMapChildStateFactory, urlPath, siteMapSettings)
 {
 }
        public RequestCacheableSiteMap(
            ISiteMapPluginProvider pluginProvider,
            IMvcContextFactory mvcContextFactory,
            ISiteMapChildStateFactory siteMapChildStateFactory,
            IUrlPath urlPath,
            ISiteMapSettings siteMapSettings,
            IRequestCache requestCache
            )
            : base(pluginProvider, mvcContextFactory, siteMapChildStateFactory, urlPath, siteMapSettings)
        {
            if (requestCache == null)
                throw new ArgumentNullException("requestCache");

            this.requestCache = requestCache;
        }
Ejemplo n.º 5
0
        public RequestCacheableSiteMap(
            ISiteMapPluginProvider pluginProvider,
            IMvcContextFactory mvcContextFactory,
            ISiteMapChildStateFactory siteMapChildStateFactory,
            IUrlPath urlPath,
            ISiteMapSettings siteMapSettings,
            IRequestCache requestCache
            )
            : base(pluginProvider, mvcContextFactory, siteMapChildStateFactory, urlPath, siteMapSettings)
        {
            if (requestCache == null)
            {
                throw new ArgumentNullException("requestCache");
            }

            this.requestCache = requestCache;
        }
Ejemplo n.º 6
0
        public SiteMap(
            ISiteMapPluginProvider pluginProvider,
            IMvcContextFactory mvcContextFactory,
            ISiteMapChildStateFactory siteMapChildStateFactory,
            IUrlPath urlPath,
            ISiteMapSettings siteMapSettings
            )
        {
            if (pluginProvider == null)
            {
                throw new ArgumentNullException("pluginProvider");
            }
            if (mvcContextFactory == null)
            {
                throw new ArgumentNullException("mvcContextFactory");
            }
            if (siteMapChildStateFactory == null)
            {
                throw new ArgumentNullException("siteMapChildStateFactory");
            }
            if (urlPath == null)
            {
                throw new ArgumentNullException("urlPath");
            }
            if (siteMapSettings == null)
            {
                throw new ArgumentNullException("siteMapSettings");
            }

            this.pluginProvider           = pluginProvider;
            this.mvcContextFactory        = mvcContextFactory;
            this.siteMapChildStateFactory = siteMapChildStateFactory;
            this.urlPath         = urlPath;
            this.siteMapSettings = siteMapSettings;

            // Initialize dictionaries
            this.childNodeCollectionTable = siteMapChildStateFactory.CreateChildNodeCollectionDictionary();
            this.keyTable        = siteMapChildStateFactory.CreateKeyDictionary();
            this.parentNodeTable = siteMapChildStateFactory.CreateParentNodeDictionary();
            this.urlTable        = siteMapChildStateFactory.CreateUrlDictionary();
        }
Ejemplo n.º 7
0
        public virtual ISiteMap Create(ISiteMapBuilder siteMapBuilder, ISiteMapSettings siteMapSettings)
        {
            var routes = mvcContextFactory.GetRoutes();
            var requestCache = mvcContextFactory.GetRequestCache();

            // IMPORTANT: We need to ensure there is one instance of controllerTypeResolver and
            // one instance of ActionMethodParameterResolver per SiteMap instance because each of
            // these classes does internal caching.
            var controllerTypeResolver = controllerTypeResolverFactory.Create(routes);
            var actionMethodParameterResolver = actionMethodParameterResolverFactory.Create();
            var mvcResolver = mvcResolverFactory.Create(controllerTypeResolver, actionMethodParameterResolver);
            var pluginProvider = pluginProviderFactory.Create(siteMapBuilder, mvcResolver);

            return new RequestCacheableSiteMap(
                pluginProvider,
                mvcContextFactory,
                siteMapChildStateFactory,
                urlPath,
                siteMapSettings,
                requestCache);
        }
Ejemplo n.º 8
0
        public virtual ISiteMap Create(ISiteMapBuilder siteMapBuilder, ISiteMapSettings siteMapSettings)
        {
            var routes       = mvcContextFactory.GetRoutes();
            var requestCache = mvcContextFactory.GetRequestCache();

            // IMPORTANT: We need to ensure there is one instance of controllerTypeResolver and
            // one instance of ActionMethodParameterResolver per SiteMap instance because each of
            // these classes does internal caching.
            var controllerTypeResolver        = controllerTypeResolverFactory.Create(routes);
            var actionMethodParameterResolver = actionMethodParameterResolverFactory.Create();
            var mvcResolver    = mvcResolverFactory.Create(controllerTypeResolver, actionMethodParameterResolver);
            var pluginProvider = pluginProviderFactory.Create(siteMapBuilder, mvcResolver);

            return(new RequestCacheableSiteMap(
                       pluginProvider,
                       mvcContextFactory,
                       siteMapChildStateFactory,
                       urlPath,
                       siteMapSettings,
                       requestCache));
        }