Beispiel #1
0
        public static string MediaUrl(this SueetieMediaDirectory _sueetieMediaDirectory, SueetieImageDisplayType _sueetieImageDisplayType, bool DisplayDomain)
        {
            var _host = DisplayDomain ? HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) : string.Empty;
            var _url  = string.Format("{0}/{1}/gs/mediaobjects{2}{3}",
                                      _host, _sueetieMediaDirectory.ApplicationKey, _sueetieMediaDirectory.SueetieAlbumPath,
                                      SueetieMedia.GetSueetieMediaDirectoryFileName(_sueetieImageDisplayType, _sueetieMediaDirectory));

            return(_url);
        }
Beispiel #2
0
        public static string GetSueetieMediaDirectoryFileName(SueetieImageDisplayType sueetieImageDisplayType, SueetieMediaDirectory sueetieMediaDirectory)
        {
            var filename = string.Empty;

            switch (sueetieImageDisplayType)
            {
            case SueetieImageDisplayType.Unknown:
            case SueetieImageDisplayType.External:
            case SueetieImageDisplayType.Thumbnail:
                filename = sueetieMediaDirectory.ThumbnailFilename;
                break;

            case SueetieImageDisplayType.Optimized:
                filename = sueetieMediaDirectory.OptimizedFilename;
                break;

            case SueetieImageDisplayType.Original:
                filename = sueetieMediaDirectory.OriginalFilename;
                break;

            default:
                break;
            }
            return(filename);
        }
Beispiel #3
0
 public static string MediaUrl(this SueetieMediaDirectory _sueetieMediaDirectory, SueetieImageDisplayType _sueetieImageDisplayType)
 {
     return(MediaUrl(_sueetieMediaDirectory, _sueetieImageDisplayType, true));
 }
Beispiel #4
0
 public static string MediaOriginalUrl(this SueetieMediaDirectory _sueetieMediaDirectory)
 {
     return(MediaUrl(_sueetieMediaDirectory, SueetieImageDisplayType.Original, true));
 }
Beispiel #5
0
 public static string MediaOptimizedUrl(this SueetieMediaDirectory _sueetieMediaDirectory)
 {
     return(MediaUrl(_sueetieMediaDirectory, SueetieImageDisplayType.Optimized, true));
 }
Beispiel #6
0
 public static string MediaThumbnailUrl(this SueetieMediaDirectory _sueetieMediaDirectory)
 {
     return(MediaUrl(_sueetieMediaDirectory, SueetieImageDisplayType.Thumbnail, true));
 }