private void initContent(string photoId) { if (!String.IsNullOrEmpty(tagId)) tag = PhotoLibrary.GetTag(tagId); CurrentPhoto = PhotoLibrary.GetPhoto(photoId); var nextPhoto = PhotoLibrary.GetNextPhoto(photoId, tagId); if (nextPhoto != null) { NextPhotoLink.PhotoId = nextPhoto.Id; NextPhotoLink.TagId = tagId; NextPhotoLink.HoverIconUrl = "/App_Themes/" + Theme + "/images/go-next.png"; NextPhoto = nextPhoto; FullSizePhoto.Loaded = String.Format(@"preload('{0}')",PhotoFile.GetUrlFor(nextPhoto.Id, PhotoFileSize.Normal)); } else NextPhotoLink.Visible = false; var previousPhoto = PhotoLibrary.GetPreviousPhoto(photoId, tagId); if (previousPhoto != null) { PreviousPhotoLink.TagId = tagId; PreviousPhotoLink.PhotoId = previousPhoto.Id; PreviousPhotoLink.HoverIconUrl = "/App_Themes/" + Theme + "/images/go-previous.png"; } else PreviousPhotoLink.Visible = false; FullSizePhoto.PhotoId = photoId; FullSizePhoto.Metadatas = CurrentPhoto.Metadatas; this.CalendarLink.NavigateUrl = MonthCalendar.GetUrlFor(CurrentPhoto.Date, tagId); tagList.Tags = PhotoLibrary.GetTagsByPhoto(CurrentPhoto.Id); if (CurrentPhoto.Latitude.HasValue && CurrentPhoto.Longitude.HasValue) { this.PhotoMap.Visible = true; this.PhotoMap.Latitude = CurrentPhoto.Latitude.Value; this.PhotoMap.Longitude = CurrentPhoto.Longitude.Value; this.PhotoMap.ThumbnailUrl = PhotoFile.GetUrlFor(photoId, PhotoFileSize.Thumbnail); } else { this.PhotoMap.Visible = false; } }
private static string getFile(IPhotoInfo photo, PhotoFileSize size) { return size != PhotoFileSize.Raw ? PhotoFileProvider.GetResizedPhoto(photo.MediaFilePath, size) : photo.MediaFilePath; }
public PhotoFileResult(IPhotoInfo photo, PhotoFileSize size) : base(getFile(photo, size), "image/jpeg") { }