csharp 适用于MVCSiteMapProvider 4.0的Visiblity Provider

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了csharp 适用于MVCSiteMapProvider 4.0的Visiblity Provider相关的知识,希望对你有一定的参考价值。

namespace MyCompany.Web
{
    public class MyCompanySiteMapVisibilityProvider : MvcSiteMapProvider.SiteMapNodeVisibilityProviderBase
    {
        public override bool IsVisible(ISiteMapNode node, IDictionary<string, object> sourceMetadata)
        {
            if (node == null)
            {
                return true;
            }

            // Is a visibility attribute specified?
            var visibilityValue = node.Attributes.GetValue("visibility");
            if (visibilityValue != null)
            {
                bool nodeVisible;
                string visibility = visibilityValue.ToString();

                if (bool.TryParse(visibility, out nodeVisible))
                {
                    return nodeVisible;
                }
            }
            return true;
        }
    }
}

以上是关于csharp 适用于MVCSiteMapProvider 4.0的Visiblity Provider的主要内容,如果未能解决你的问题,请参考以下文章

csharp 适用于.NET MVC Modern UI的GroupDocs.Viewer

csharp 适用于.NET MVC Modern UI的GroupDocs.Viewer

csharp 适用于.NET MVC Modern UI的GroupDocs.Viewer

csharp 适用于.NET MVC Modern UI的GroupDocs.Viewer

csharp 适用于.NET MVC Modern UI的GroupDocs.Viewer

csharp 适用于.NET MVC Modern UI的GroupDocs.Viewer