Carrotware.CMS.UI.Controls.BaseNavSel.LoadChildren C# (CSharp) Метод

LoadChildren() защищенный Метод

protected LoadChildren ( System.Web.UI.HtmlTextWriter output, System.Guid rootContentID, string sItemCSS, int iParent, int iLevel ) : void
output System.Web.UI.HtmlTextWriter
rootContentID System.Guid
sItemCSS string
iParent int
iLevel int
Результат void
        protected virtual void LoadChildren(HtmlTextWriter output, Guid rootContentID, string sItemCSS, int iParent, int iLevel)
        {
            List<SiteNav> lstNav = GetChildren(rootContentID);
            int indent = output.Indent;
            output.Indent = indent + 1;

            string sThis2CSS = sItemCSS;

            if (lstNav != null && lstNav.Any()) {
                output.WriteLine();
                output.WriteLine("<ul id=\"listitem" + iParent.ToString() + "-childlist\" class=\"childlist childlevel" + iLevel + " " + this.CSSULClassLower + "\">");
                int indent2 = output.Indent + 1;
                foreach (SiteNav c2 in lstNav) {
                    output.Indent = indent2;
                    List<SiteNav> cc = GetChildren(c2.Root_ContentID);

                    if (this.MultiLevel) {
                        string sChild = " ";
                        if (cc != null && cc.Any()) {
                            sChild = " level" + iLevel + "-haschildren " + this.CSSHasChildren + " ";
                        }
                        sThis2CSS = " level" + iLevel + " " + sItemCSS + sChild;
                    } else {
                        sThis2CSS = sItemCSS;
                    }

                    if (SiteData.IsFilenameCurrentPage(c2.FileName) || AreFilenamesSame(c2.FileName, this.ParentFileName)) {
                        sThis2CSS = sThis2CSS + " " + this.CSSSelected;
                    }
                    sThis2CSS = (sThis2CSS + " child-nav").Replace("   ", " ").Replace("  ", " ").Trim();

                    iItemNumber++;
                    output.WriteLine("<li id=\"listitem" + iItemNumber.ToString() + "\" class=\"" + sThis2CSS + "\"><a href=\"" + c2.FileName + "\">" + c2.NavMenuText + "</a>");
                    int indent3 = output.Indent;
                    if (cc != null && cc.Any()) {
                        LoadChildren(output, c2.Root_ContentID, sItemCSS, iItemNumber, iLevel + 1);
                    }
                    output.Indent = indent3;
                    output.Write("</li>");

                    output.WriteLine();
                }
                output.Indent--;
                output.WriteLine("</ul> ");
            }

            output.Indent = indent;
        }