private ISiteMapNodeUrlResolver[] ResolveSiteMapNodeUrlResolvers()
        {
            var instantiator       = new PluginInstantiator <ISiteMapNodeUrlResolver>();
            var typeNames          = this.GetMvcSiteMapNodeXmlDistinctAttributeValues("urlResolver");
            var attributeTypeNames = this.GetMvcSiteMapNodeAttributeUrlResolverNames();

            foreach (var typeName in attributeTypeNames)
            {
                if (!typeNames.Contains(typeName))
                {
                    typeNames.Add(typeName);
                }
            }

            // Add the default provider if it is missing
            var defaultName = typeof(SiteMapNodeUrlResolver).ShortAssemblyQualifiedName();

            if (!typeNames.Contains(defaultName))
            {
                typeNames.Add(defaultName);
            }

            var providers = instantiator.GetInstances(typeNames, new object[] { this.mvcContextFactory, this.urlPath });

            return(providers.ToArray());
        }
        private ISiteMapNodeVisibilityProvider[] ResolveSiteMapNodeVisibilityProviders(string defaultVisibilityProviderName)
        {
            var instantiator = new PluginInstantiator <ISiteMapNodeVisibilityProvider>();
            var xmlSource    = new FileXmlSource(this.absoluteFileName);
            var typeNames    = xmlAggergator.GetAttributeValues(xmlSource, "visibilityProvider");

            var attributeTypeNames = this.GetMvcSiteMapNodeAttributeVisibilityProviderNames();

            foreach (var typeName in attributeTypeNames)
            {
                if (!typeNames.Contains(typeName))
                {
                    typeNames.Add(typeName);
                }
            }

            // Fixes #196, default instance not created.
            if (!String.IsNullOrEmpty(defaultVisibilityProviderName) && !typeNames.Contains(defaultVisibilityProviderName))
            {
                typeNames.Add(defaultVisibilityProviderName);
            }
            var providers = instantiator.GetInstances(typeNames);

            return(providers.ToArray());
        }
 private IDynamicNodeProvider[] ResolveDynamicNodeProviders()
 {
     var instantiator = new PluginInstantiator<IDynamicNodeProvider>();
     var xmlSource = new FileXmlSource(this.absoluteFileName);
     var typeNames = xmlAggergator.GetAttributeValues(xmlSource, "dynamicNodeProvider");
     var providers = instantiator.GetInstances(typeNames);
     return providers.ToArray();
 }
示例#4
0
        private IDynamicNodeProvider[] ResolveDynamicNodeProviders()
        {
            var instantiator = new PluginInstantiator <IDynamicNodeProvider>();
            var xmlSource    = new FileXmlSource(this.absoluteFileName);
            var typeNames    = xmlAggergator.GetAttributeValues(xmlSource, "dynamicNodeProvider");
            var providers    = instantiator.GetInstances(typeNames);

            return(providers.ToArray());
        }
示例#5
0
        private ISiteMapNodeUrlResolver[] ResolveSiteMapNodeUrlResolvers()
        {
            var instantiator = new PluginInstantiator <ISiteMapNodeUrlResolver>();
            var xmlSource    = new FileXmlSource(this.absoluteFileName);
            var typeNames    = xmlAggergator.GetAttributeValues(xmlSource, "urlResolver");

            // Add the default provider if it is missing
            var defaultName = typeof(SiteMapNodeUrlResolver).ShortAssemblyQualifiedName();

            if (!typeNames.Contains(defaultName))
            {
                typeNames.Add(defaultName);
            }

            var providers = instantiator.GetInstances(typeNames, new object[] { this.mvcContextFactory });

            return(providers.ToArray());
        }
        private IDynamicNodeProvider[] ResolveDynamicNodeProviders()
        {
            var instantiator       = new PluginInstantiator <IDynamicNodeProvider>();
            var typeNames          = this.GetMvcSiteMapNodeXmlDistinctAttributeValues("dynamicNodeProvider");
            var attributeTypeNames = this.GetMvcSiteMapNodeAttributeDynamicNodeProviderNames();

            foreach (var typeName in attributeTypeNames)
            {
                if (!typeNames.Contains(typeName))
                {
                    typeNames.Add(typeName);
                }
            }

            var providers = instantiator.GetInstances(typeNames);

            return(providers.ToArray());
        }
        private IDynamicNodeProvider[] ResolveDynamicNodeProviders()
        {
            var instantiator = new PluginInstantiator <IDynamicNodeProvider>();
            var xmlSource    = new FileXmlSource(this.absoluteFileName);
            var typeNames    = xmlAggergator.GetAttributeValues(xmlSource, "dynamicNodeProvider");

            var attributeTypeNames = this.GetMvcSiteMapNodeAttributeDynamicNodeProviderNames();

            foreach (var typeName in attributeTypeNames)
            {
                if (!typeNames.Contains(typeName))
                {
                    typeNames.Add(typeName);
                }
            }

            var providers = instantiator.GetInstances(typeNames);

            return(providers.ToArray());
        }
        private ISiteMapNodeVisibilityProvider[] ResolveSiteMapNodeVisibilityProviders(string defaultVisibilityProviderName)
        {
            var instantiator = new PluginInstantiator<ISiteMapNodeVisibilityProvider>();
            var typeNames = this.GetMvcSiteMapNodeXmlDistinctAttributeValues("visibilityProvider");
            var attributeTypeNames = this.GetMvcSiteMapNodeAttributeVisibilityProviderNames();
            foreach (var typeName in attributeTypeNames)
            {
                if (!typeNames.Contains(typeName))
                {
                    typeNames.Add(typeName);
                }
            }

            // Fixes #196, default instance not created.
            if (!string.IsNullOrEmpty(defaultVisibilityProviderName) && !typeNames.Contains(defaultVisibilityProviderName))
            {
                typeNames.Add(defaultVisibilityProviderName);
            }
            var providers = instantiator.GetInstances(typeNames);
            return providers.ToArray();
        }
        private ISiteMapNodeUrlResolver[] ResolveSiteMapNodeUrlResolvers()
        {
            var instantiator = new PluginInstantiator<ISiteMapNodeUrlResolver>();
            var typeNames = this.GetMvcSiteMapNodeXmlDistinctAttributeValues("urlResolver");
            var attributeTypeNames = this.GetMvcSiteMapNodeAttributeUrlResolverNames();
            foreach (var typeName in attributeTypeNames)
            {
                if (!typeNames.Contains(typeName))
                {
                    typeNames.Add(typeName);
                }
            }

            // Add the default provider if it is missing
            var defaultName = typeof(SiteMapNodeUrlResolver).ShortAssemblyQualifiedName();
            if (!typeNames.Contains(defaultName))
            {
                typeNames.Add(defaultName);
            }

            var providers = instantiator.GetInstances(typeNames, new object[] { this.mvcContextFactory, this.urlPath });
            return providers.ToArray();
        }
        private IDynamicNodeProvider[] ResolveDynamicNodeProviders()
        {
            var instantiator = new PluginInstantiator<IDynamicNodeProvider>();
            var typeNames = this.GetMvcSiteMapNodeXmlDistinctAttributeValues("dynamicNodeProvider");
            var attributeTypeNames = this.GetMvcSiteMapNodeAttributeDynamicNodeProviderNames();
            foreach (var typeName in attributeTypeNames)
            {
                if (!typeNames.Contains(typeName))
                {
                    typeNames.Add(typeName);
                }
            }

            var providers = instantiator.GetInstances(typeNames);
            return providers.ToArray();
        }
        private ISiteMapNodeUrlResolver[] ResolveSiteMapNodeUrlResolvers()
        {
            var instantiator = new PluginInstantiator<ISiteMapNodeUrlResolver>();
            var xmlSource = new FileXmlSource(this.absoluteFileName);
            var typeNames = xmlAggergator.GetAttributeValues(xmlSource, "urlResolver");

            // Add the default provider if it is missing
            var defaultName = typeof(SiteMapNodeUrlResolver).ShortAssemblyQualifiedName();
            if (!typeNames.Contains(defaultName))
            {
                typeNames.Add(defaultName);
            }

            var providers = instantiator.GetInstances(typeNames, new object[] { this.mvcContextFactory });
            return providers.ToArray();
        }
        private ISiteMapNodeVisibilityProvider[] ResolveSiteMapNodeVisibilityProviders(string defaultVisibilityProviderName)
        {
            var instantiator = new PluginInstantiator<ISiteMapNodeVisibilityProvider>();
            var xmlSource = new FileXmlSource(this.absoluteFileName);
            var typeNames = xmlAggergator.GetAttributeValues(xmlSource, "visibilityProvider");

            // Fixes #196, default instance not created.
            if (!String.IsNullOrEmpty(defaultVisibilityProviderName) && !typeNames.Contains(defaultVisibilityProviderName))
            {
                typeNames.Add(defaultVisibilityProviderName);
            }
            var providers = instantiator.GetInstances(typeNames);
            return providers.ToArray();
        }
        private IDynamicNodeProvider[] ResolveDynamicNodeProviders()
        {
            var instantiator = new PluginInstantiator<IDynamicNodeProvider>();
            var xmlSource = new FileXmlSource(this.absoluteFileName);
            var typeNames = xmlAggergator.GetAttributeValues(xmlSource, "dynamicNodeProvider");

            var attributeTypeNames = this.GetMvcSiteMapNodeAttributeDynamicNodeProviderNames();
            foreach (var typeName in attributeTypeNames)
            {
                if (!typeNames.Contains(typeName))
                {
                    typeNames.Add(typeName);
                }
            }

            var providers = instantiator.GetInstances(typeNames);
            return providers.ToArray();
        }