Пример #1
0
        public string Render(IFlickrRepository flickrRepository, string id)
        {
            var result = "<div class='post-image'>";

            var photo = flickrRepository.GetById(int.Parse(id));
            result +=
                    string.Format("<a class='fancybox' href='{0}' title='{1}'><img border='0' alt='{2}' src='{2}'></a>",
                    photo.UrlImageMedium800, photo.Description, photo.UrlImageMedium500);

            result += "</div>";

            return result;
        }
Пример #2
0
        public string Render(IFlickrRepository flickrRepository, string ids)
        {
            var splittedId = ids.Split(new char[] {','}, StringSplitOptions.RemoveEmptyEntries);
            var idList = splittedId.Select(int.Parse).ToList();

            var result = "<div class='post-imageset-gallery'>";
            foreach (var id in idList)
            {
                var photo = flickrRepository.GetById(id);
                result +=
                    string.Format("<a class='fancybox' href='{0}' rel='group' title='{1}'><img alt='' src='{2}'></a>",
                    photo.UrlImageMedium800, photo.Description, photo.UrlImageSquareLarge);
            }
            result += "</div>";

            return result;
        }