public void AddUrl(string url, SiteMapPriority priority)
        {
            var n = new SiteMapNode {
                Url = url, Priority = priority
            };

            // Site Map can't exceed 50,000 according to specs
            if (Children.Count < 49999)
            {
                Children.Add(n);
            }
        }
Esempio n. 2
0
        public string GetProperty(string propertyName, string format, CultureInfo formatProvider, UserInfo accessingUser, Scope currentScope, ref bool propertyNotFound)
        {
            string outputFormat = string.Empty;

            if (format == string.Empty)
            {
                outputFormat = "g";
            }

            string lowerPropertyName = propertyName.ToLower();

            if (currentScope == Scope.NoSettings)
            {
                propertyNotFound = true;
                return(PropertyAccess.ContentLocked);
            }
            propertyNotFound = true;

            string result   = string.Empty;
            bool   isPublic = true;

            switch (lowerPropertyName)
            {
            case "tabid":
                propertyNotFound = false;
                result           = (TabID.ToString(outputFormat, formatProvider));
                break;

            case "taborder":
                isPublic         = false;
                propertyNotFound = false;
                result           = (TabOrder.ToString(outputFormat, formatProvider));
                break;

            case "portalid":
                propertyNotFound = false;
                result           = (PortalID.ToString(outputFormat, formatProvider));
                break;

            case "tabname":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(LocalizedTabName, format);
                break;

            case "isvisible":
                isPublic         = false;
                propertyNotFound = false;
                result           = (PropertyAccess.Boolean2LocalizedYesNo(IsVisible, formatProvider));
                break;

            case "parentid":
                isPublic         = false;
                propertyNotFound = false;
                result           = (ParentId.ToString(outputFormat, formatProvider));
                break;

            case "level":
                isPublic         = false;
                propertyNotFound = false;
                result           = (Level.ToString(outputFormat, formatProvider));
                break;

            case "iconfile":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(IconFile, format);
                break;

            case "iconfilelarge":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(IconFileLarge, format);
                break;

            case "disablelink":
                isPublic         = false;
                propertyNotFound = false;
                result           = (PropertyAccess.Boolean2LocalizedYesNo(DisableLink, formatProvider));
                break;

            case "title":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(Title, format);
                break;

            case "description":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(Description, format);
                break;

            case "keywords":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(KeyWords, format);
                break;

            case "isdeleted":
                isPublic         = false;
                propertyNotFound = false;
                result           = (PropertyAccess.Boolean2LocalizedYesNo(IsDeleted, formatProvider));
                break;

            case "url":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(Url, format);
                break;

            case "skinsrc":
                isPublic         = false;
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(SkinSrc, format);
                break;

            case "containersrc":
                isPublic         = false;
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(ContainerSrc, format);
                break;

            case "tabpath":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(TabPath, format);
                break;

            case "startdate":
                isPublic         = false;
                propertyNotFound = false;
                result           = (StartDate.ToString(outputFormat, formatProvider));
                break;

            case "enddate":
                isPublic         = false;
                propertyNotFound = false;
                result           = (EndDate.ToString(outputFormat, formatProvider));
                break;

            case "haschildren":
                isPublic         = false;
                propertyNotFound = false;
                result           = (PropertyAccess.Boolean2LocalizedYesNo(HasChildren, formatProvider));
                break;

            case "refreshinterval":
                isPublic         = false;
                propertyNotFound = false;
                result           = (RefreshInterval.ToString(outputFormat, formatProvider));
                break;

            case "pageheadtext":
                isPublic         = false;
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(PageHeadText, format);
                break;

            case "skinpath":
                isPublic         = false;
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(SkinPath, format);
                break;

            case "skindoctype":
                isPublic         = false;
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(SkinDoctype, format);
                break;

            case "containerpath":
                isPublic         = false;
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(ContainerPath, format);
                break;

            case "issupertab":
                isPublic         = false;
                propertyNotFound = false;
                result           = (PropertyAccess.Boolean2LocalizedYesNo(IsSuperTab, formatProvider));
                break;

            case "fullurl":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(FullUrl, format);
                break;

            case "sitemappriority":
                propertyNotFound = false;
                result           = PropertyAccess.FormatString(SiteMapPriority.ToString(), format);
                break;
            }
            if (!isPublic && currentScope != Scope.Debug)
            {
                propertyNotFound = true;
                result           = PropertyAccess.ContentLocked;
            }
            return(result);
        }