Exemplo n.º 1
0
        /// <summary>
        /// Gets the Forums.
        /// </summary>
        /// <param name="item">
        /// The item.
        /// </param>
        /// <returns>
        /// Returns the Forums
        /// </returns>
        protected Tuple <List <SimpleModerator>, List <ForumRead> > GetForums([NotNull] ForumRead item)
        {
            var forums = this.Data;

            return(new Tuple <List <SimpleModerator>, List <ForumRead> >(
                       forums.Item1,
                       forums.Item2.Where(forum => forum.CategoryID == item.CategoryID).ToList()));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the Category Image
        /// </summary>
        /// <param name="forum">
        /// The forum.
        /// </param>
        /// <returns>
        /// The <see cref="string"/>.
        /// </returns>
        public string GetCategoryImage([NotNull] ForumRead forum)
        {
            var hasCategoryImage = forum.CategoryImage.IsSet();

            var image = new Image
            {
                ImageUrl =
                    $"{BoardInfo.ForumClientFileRoot}{this.Get<BoardFolders>().Categories}/{forum.CategoryImage}",
                AlternateText = forum.Category
            };

            var icon = new Icon {
                IconName = "folder", IconType = "text-warning"
            };

            return(hasCategoryImage
                       ? $"{image.RenderToString()}&nbsp;"
                       : $"{icon.RenderToString()}&nbsp;");
        }