Example #1
0
        public virtual string PostBody(int thumbnailSize, bool includePriceAndSource = true, bool tagsAsText = true)
        {
            var programOptionsFactory = new ProgramOptionsFactory();
            var programOptions = programOptionsFactory.Get();
            var converterFunctions = new ConverterFunctions();
            var content = new StringBuilder("");
            if (ItemImages.Count > 0)
            {
                content.Append(string.Format("<div style=\"width: {0}px; margin-right: 10px;\">", (2 * thumbnailSize + 30)));
                foreach (var itemImage in ItemImages)
                {
                    content.Append(string.Format(
                        "<div style=\"width: {3}px; height: {3}px; float: left; margin-right: 15px; margin-bottom: 3px;\"><a href=\"{0}\"><img src=\"{1}\" alt=\"{2}\" title=\"{2}\" /></a></div>",
                        itemImage.Link, itemImage.NewSource, Title, thumbnailSize));

                }
                content.Append("</div>");

            }

            if (((int)(Price * 100)) > 0 && includePriceAndSource)
            {
                content.Append(string.Format("<h4>Price:{1}{0}</h4>", Price, programOptions.PriceSign));
            }
            content.Append(string.Format("<h2>{0}</h2>", Title));
            content.Append(converterFunctions.ArrangeContent(Content));
            if (!string.IsNullOrEmpty(Url) && includePriceAndSource)
            {
                content.Append(SourceStatement());
            }

            if (Tags != null && Tags.Count > 0 && tagsAsText && includePriceAndSource)
            {
                content.Append("<br/>Tags: ");
                content.Append(string.Join(", ", Tags));
            }
            return content.ToString();
        }