示例#1
0
        internal static string ImageToli(Smugmug.Album album, Smugmug.Image image, bool useLightBox)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("<li>\n<div>");

            if (useLightBox)
            {
                builder.Append(string.Format("<a href=\"{0}\" title=\"{1}\" rel=\"lightbox[{2}]\">", image.LargeUrl, Utils.CaptionToHtml(image.Caption), album.Key));
            }
            else
            {
                builder.Append(string.Format("<a href=\"{0}\" title=\"{1}\">", image.LargeUrl, Utils.CaptionToHtml(image.Caption)));
            }
            builder.Append(string.Format("<img src=\"{0}\" alt=\"{1}\">", image.ThumbUrl, Utils.CaptionToHtml(image.Caption)));
            builder.Append("<br>");
            if (image.Caption != "")
            {
                builder.Append(string.Format("{0}", Utils.CaptionToHtml(image.Caption)));
            }
            else
            {
                builder.Append(string.Format("{0}", "&nbsp;"));
            }
            builder.Append("</a></div>\n</li>");
            return(builder.ToString());
        }
示例#2
0
        internal static string GenerateGalleryHtml(Smugmug.Album album, Smugmug.Image[] images, bool includeCss, bool useLightBox)
        {
            StringBuilder galleryHtml = new StringBuilder();

            galleryHtml.Append(SmugMug4writer.Properties.Settings.Default.GalleryCSS);
            galleryHtml.Append("<div class=\"smugcontainer\"><div class=\"smugimg\">\n<ul>\n");
            foreach (Smugmug.Image image in images)
            {
                galleryHtml.Append(ImageToli(album, image, useLightBox));
            }
            galleryHtml.Append("</ul>\n</div></div>\n");

            return(galleryHtml.ToString());
        }