예제 #1
0
        protected ICollection <LinkCategory> GetArchiveCategories(Blog blog)
        {
            var linkCategories = new List <LinkCategory>();

            // we want to make sure that the LinkCategory is NOT null before we add it to the collection.
            LinkCategory category = UIData.Links(CategoryType.PostCollection, blog, Url);

            if (category != null)
            {
                linkCategories.Add(category);
            }
            category = UIData.Links(CategoryType.StoryCollection, blog, Url);
            if (category != null)
            {
                linkCategories.Add(category);
            }
            category = UIData.ArchiveMonth(Url, blog);
            if (category != null)
            {
                linkCategories.Add(category);
            }
            category = UIData.Links(CategoryType.ImageCollection, blog, Url);
            if (category != null)
            {
                linkCategories.Add(category);
            }
            return(linkCategories);
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            var lcc = new List <LinkCategory>();

            lcc.AddRange(Links.GetCategories(CategoryType.PostCollection, ActiveFilter.None));
            lcc.Add(UIData.Links(CategoryType.PostCollection, SubtextContext.Blog, Url));
            CatList.DataSource = lcc;
            CatList.DataBind();

            LinkCategory monthCat = UIData.ArchiveMonth(Url, Blog);

            DateItemList.DataSource = monthCat.Links;
            DateItemList.DataBind();
        }
예제 #3
0
        protected ICollection <LinkCategory> GetArchiveCategories(Blog blog)
        {
            var lcc = new List <LinkCategory>();

            LinkCategory storyCollection = UIData.Links(CategoryType.StoryCollection, blog, Url);

            if (storyCollection != null)
            {
                lcc.Add(storyCollection);
            }

            LinkCategory archiveMonth = UIData.ArchiveMonth(Url, blog);

            if (archiveMonth != null)
            {
                lcc.Add(archiveMonth);
            }

            /*
             * Uncomment this to test the Category Archive with post count
             * and comment to following block of code
             */

            //LinkCategory archiveCategories = UIData.ArchiveCategory(CurrentBlog.UrlFormats);
            //if (archiveCategories != null)
            //    lcc.Add(archiveCategories);


            LinkCategory postCollection = UIData.Links(CategoryType.PostCollection, blog, Url);

            if (postCollection != null)
            {
                lcc.Add(postCollection);
            }

            LinkCategory imageCollection = UIData.Links(CategoryType.ImageCollection, blog, Url);

            if (imageCollection != null)
            {
                lcc.Add(imageCollection);
            }

            lcc.AddRange(Repository.GetActiveCategories());
            return(lcc);
        }
 protected ICollection <LinkCategory> GetArchiveCategories(Blog blog)
 {
     return(new List <LinkCategory> {
         UIData.Links(CategoryType.StoryCollection, blog, Url)
     });
 }