示例#1
0
        public void AddEditorPageLinks(EditorLinkCollection links)
        {
            EditorLink articlesLink = new EditorLink("Articles", null);

            List<BlogArticle> articles = BlogArticles;

            if (articles != null)
            {
                foreach (BlogArticle article in articles)
                {
                    String href = LinkUtils.ResolveClientUrl(LinkUtils.GetArticleUrl(article.IndexName));

                    articlesLink.ChildLinks.Add(new EditorLink(article.Title, href));
                }
            }

            links.Add(articlesLink);
        }
示例#2
0
        public void AddEditorPageLinks(EditorLinkCollection links)
        {
            EditorLink pageLink = new EditorLink("Pages", null);

            foreach (PageGroupInfo group in Groups)
            {
                EditorLink groupLink = new EditorLink(group.Name, null);

                foreach (PageSectionInfo section in group.Sections)
                {
                    EditorLink sectionLink = new EditorLink(section.Name, null);

                    foreach (PageInfo page in section.Pages)
                    {
                        String href = LinkUtils.ResolveClientUrl(LinkUtils.GetPageUrl(page.FullName));

                        sectionLink.ChildLinks.Add(new EditorLink(page.Name, href));
                    }

                    if (sectionLink.ChildLinks.Count > 0)
                        groupLink.ChildLinks.Add(sectionLink);
                }

                if (groupLink.ChildLinks.Count > 0)
                    pageLink.ChildLinks.Add(groupLink);
            }

            links.Add(pageLink);
        }