Esempio n. 1
0
//        /// <summary>
//        /// Generates the HTML to display a nicely formatted thumbnail image, including a
//        /// border, shadows and (possibly) rounded corners.
//        /// </summary>
//        /// <returns>Returns HTML that displays a nicely formatted thumbnail image.</returns>
//        public string GetThumbnailHtml()
//        {
//            return String.Format(CultureInfo.InvariantCulture, @"
//    <div class='gsp_i_c'>
//      <img src='{1}' title='{2}' alt='{2}' style='width:{0}px;height:{3}px;' class='gsp_thmb_img' />
//    </div>
//",
//                                        GalleryObject.Thumbnail.Width, // 0
//                                        GetMediaObjectUrl(), // 1
//                                        _htmlController.HtmlEncode(Utils.RemoveHtmlTags(GalleryObject.Title)), // 2
//                                        GalleryObject.Thumbnail.Height // 3
//              );
//        }

        #endregion

        #region Public Static Methods

        /// <summary>
        /// Gets an instance of <see cref="MediaObjectHtmlBuilderOptions" /> that can be supplied to the
        /// <see cref="MediaObjectHtmlBuilder" /> constructor. This method requires access to <see cref="HttpContext.Current" />.
        /// </summary>
        /// <param name="galleryObject">The gallery object. May be null. If null, <see cref="MediaObjectHtmlBuilderOptions.GalleryObject" />
        ///     must be assigned before passing this instance to the <see cref="MediaObjectHtmlBuilder" /> constructor.</param>
        /// <param name="urlController"></param>
        /// <param name="displayType">The display type. Optional. If not assigned or set to <see cref="DisplayObjectType.Unknown" />,
        ///     <see cref="MediaObjectHtmlBuilderOptions.DisplayType" /> must be assigned before passing this instance to the
        ///     <see cref="MediaObjectHtmlBuilder" /> constructor.</param>
        /// <returns>An instance of <see cref="MediaObjectHtmlBuilderOptions" />.</returns>
        public static MediaObjectHtmlBuilderOptions GetMediaObjectHtmlBuilderOptions(IGalleryObject galleryObject, UrlController urlController, DisplayObjectType displayType = DisplayObjectType.Unknown)
        {
            return(new MediaObjectHtmlBuilderOptions(galleryObject, displayType, new [] { "default" }, urlController.GetCurrentPageUrl(), urlController.GetHostUrl(), urlController.GetAppRoot(), urlController.GetGalleryRoot()));
        }