Exemplo n.º 1
0
        public static IHtmlString prettyPhotoSingleImage(this HtmlHelper html, prettyPhotoMedia media)
        {
            var abuilder = new TagBuilder("a");
            abuilder.Attributes.Add(new KeyValuePair<string, string>("href", media.LargePhoto));
            abuilder.Attributes.Add(new KeyValuePair<string, string>("rel", "prettyPhoto"));
            abuilder.Attributes.Add(new KeyValuePair<string, string>("title", media.Alt));

            var imgbuilder = new TagBuilder("img");

            imgbuilder.Attributes.Add(new KeyValuePair<string, string>("src", media.Thumb));
            imgbuilder.Attributes.Add(new KeyValuePair<string, string>("alt", media.Alt));

            abuilder.InnerHtml = imgbuilder.ToString(TagRenderMode.SelfClosing);

            return MvcHtmlString.Create(abuilder.ToString(TagRenderMode.Normal));
        }
Exemplo n.º 2
0
        public static IHtmlString prettyPhotoSingleImage(this HtmlHelper html, prettyPhotoMedia media)
        {
            var abuilder = new TagBuilder("a");

            abuilder.Attributes.Add(new KeyValuePair <string, string>("href", media.LargePhoto));
            abuilder.Attributes.Add(new KeyValuePair <string, string>("rel", "prettyPhoto"));
            abuilder.Attributes.Add(new KeyValuePair <string, string>("title", media.Alt));


            var imgbuilder = new TagBuilder("img");

            imgbuilder.Attributes.Add(new KeyValuePair <string, string>("src", media.Thumb));
            imgbuilder.Attributes.Add(new KeyValuePair <string, string>("alt", media.Alt));

            abuilder.InnerHtml = imgbuilder.ToString(TagRenderMode.SelfClosing);

            return(MvcHtmlString.Create(abuilder.ToString(TagRenderMode.Normal)));
        }
Exemplo n.º 3
0
        public static IHtmlString prettyPhotoPictureGallery(this HtmlHelper html, prettyPhotoMedia media,string galleryPrefix)
        {
            var abuilder = new TagBuilder("a");
            abuilder.Attributes.Add(new KeyValuePair<string, string>("href", media.LargePhoto));

            var rel = String.Format("prettyPhoto[{0}]", galleryPrefix);

            abuilder.Attributes.Add(new KeyValuePair<string, string>("rel", rel));
            abuilder.Attributes.Add(new KeyValuePair<string, string>("title", media.Alt));

            var imgbuilder = new TagBuilder("img");

            imgbuilder.Attributes.Add(new KeyValuePair<string, string>("src", media.Thumb));
            imgbuilder.Attributes.Add(new KeyValuePair<string, string>("alt", media.Alt));

            abuilder.InnerHtml = imgbuilder.ToString(TagRenderMode.SelfClosing);

            return MvcHtmlString.Create(abuilder.ToString(TagRenderMode.Normal));
        }
Exemplo n.º 4
0
        public static IHtmlString prettyPhotoPictureGallery(this HtmlHelper html, prettyPhotoMedia media, string galleryPrefix)
        {
            var abuilder = new TagBuilder("a");

            abuilder.Attributes.Add(new KeyValuePair <string, string>("href", media.LargePhoto));

            var rel = String.Format("prettyPhoto[{0}]", galleryPrefix);

            abuilder.Attributes.Add(new KeyValuePair <string, string>("rel", rel));
            abuilder.Attributes.Add(new KeyValuePair <string, string>("title", media.Alt));


            var imgbuilder = new TagBuilder("img");

            imgbuilder.Attributes.Add(new KeyValuePair <string, string>("src", media.Thumb));
            imgbuilder.Attributes.Add(new KeyValuePair <string, string>("alt", media.Alt));

            abuilder.InnerHtml = imgbuilder.ToString(TagRenderMode.SelfClosing);

            return(MvcHtmlString.Create(abuilder.ToString(TagRenderMode.Normal)));
        }
 public static prettyPhotoMedia SimplePrettyPhotoMedia(string thumb, string large, string alt)
 {
     var prettyPhotoMatcher = new prettyPhotoMedia(thumb, large, alt);
     return prettyPhotoMatcher;
 }