Esempio n. 1
0
        public override string Render()
        {
            string html = string.Empty;

            html = TryRender(() =>
            {
                IList <KeyValue <string, string> > links = FeedHelper.LoadUrlItemsTitle(Url, NumberOfEntries);
                var buffer = new StringBuilder();

                buffer.Append("<span class=\"wtitle\">" + HttpUtility.HtmlEncode(BloggerName) + "</span>" + Environment.NewLine);
                buffer.Append("<ul>" + Environment.NewLine);
                foreach (var item in links)
                {
                    string title = StringHelper.TruncateWithText(item.Key, MaxTitleLength, "..");
                    string link  = string.Format("<li><a href=\"{0}\">{1}</a></li>", HttpUtility.HtmlEncode(item.Value), HttpUtility.HtmlEncode(title));
                    buffer.Append(link);
                }
                buffer.Append("</ul>" + Environment.NewLine);
                string finalHtml = buffer.ToString();
                return(finalHtml);
            });
            return(html);
        }