Example #1
0
        private List <BlogInfo> GetBlogsStatistic(BlogsEngine engine, int filedID, bool sortDirection)
        {
            var sort = new CMPSort(filedID, sortDirection ? SortDirection.Ascending : SortDirection.Descending);

            this.sortedFiledID = filedID;
            this.direction     = sortDirection ? SortDirection.Ascending : SortDirection.Descending;

            var stat = engine.GetAuthorsStatistic();

            var listBlogs = new List <BlogInfo>(stat.Count);

            foreach (var blog in stat)
            {
                listBlogs.Add(new BlogInfo()
                {
                    ID            = blog.Value1,
                    BlogsCount    = blog.Value2,
                    CommentsCount = blog.Value3,
                    ReviewCount   = blog.Value4,

                    Name = DisplayUserSettings.GetFullUserName(blog.Value1)
                });
            }

            listBlogs.Sort(sort);

            return(listBlogs);
        }