public string Render(Uri url, IFileViewerOptions options)
        {
            if (options.ViewType != FileViewerViewType.Preview)
                return CreateRenderedViewerMarkup(url, options.Width.HasValue ? options.Width.Value : 0, options.Height.HasValue ? options.Height.Value : 0);

            HttpContext current = HttpContext.Current;

            if (current != null)
            {
                return PublicApi.UI.GetResizedImageHtml(current.Response.ApplyAppPathModifier(this.GetPreviewImageUrl(url)), options.Height.HasValue ? options.Height.Value : 0, options.Width.HasValue ? options.Width.Value : 0);
            }

            return string.Empty;
        }
Example #2
0
        public string Render(Uri url, IFileViewerOptions options)
        {
            var pollIdString = url.Segments[url.Segments.Length - 1];
            Guid pollId;
            if (!Guid.TryParse(pollIdString, out pollId))
                throw new FileViewerNotSupportedException();

            var poll = InternalApi.PollingService.GetPoll(pollId);
            if (poll != null)
                return string.Format("<div style=\"width:{1}\"><div class=\"ui-poll\" data-pollid=\"{0}\" data-showname=\"true\" data-readonly=\"{2}\"></div></div>",
                    poll.Id.ToString(),
                    options.Width.HasValue && options.Width.Value > 0 ? options.Width.Value.ToString() + "px" : "inherit",
                    options.ViewType == FileViewerViewType.Preview ? "true" : "false"
                    );
            else
                return string.Empty;
        }
 public FileViewerMediaType GetMediaType(Uri url, IFileViewerOptions options)
 {
     return options.ViewType == FileViewerViewType.Preview ? FileViewerMediaType.Image : FileViewerMediaType.Video;
 }
 public FileViewerMediaType GetMediaType(ICentralizedFile file, IFileViewerOptions options)
 {
     return FileViewerMediaType.Empty;
 }
 public string Render(ICentralizedFile file, IFileViewerOptions options)
 {
     return string.Empty;
 }
Example #6
0
 public string Render(Evolution.Extensibility.Storage.Version1.ICentralizedFile file, IFileViewerOptions options)
 {
     throw new FileViewerNotSupportedException();
 }
Example #7
0
 public FileViewerMediaType GetMediaType(Evolution.Extensibility.Storage.Version1.ICentralizedFile file, IFileViewerOptions options)
 {
     throw new FileViewerNotSupportedException();
 }
Example #8
0
 public FileViewerMediaType GetMediaType(Uri url, IFileViewerOptions options)
 {
     return FileViewerMediaType.Video;
 }