Пример #1
0
 public FileResourcePhoto(ProjectImage projectImage)
 {
     EntityImageIDAsNullable = projectImage.ProjectImageID;
     PrimaryKey              = projectImage.ProjectImageID;
     FileResourceInfo        = projectImage.FileResourceInfo;
     DeleteUrl               = projectImage.GetDeleteUrl();
     IsKeyPhoto              = projectImage.IsKeyPhoto;
     Caption                 = projectImage.Caption;
     CaptionOnFullView       = projectImage.GetCaptionOnFullView();
     CaptionOnGallery        = projectImage.GetCaptionOnGallery();
     PhotoUrl                = projectImage.GetPhotoUrl();
     PhotoUrlScaledThumbnail = projectImage.GetPhotoUrlScaledThumbnail();
     EditUrl                 = projectImage.GetEditUrl();
     AdditionalCssClasses    = new List <string>();
 }
 public static string GetEditUrl(this ProjectImage projectImage)
 {
     return(SitkaRoute <ProjectImageController> .BuildUrlFromExpression(x => x.Edit(projectImage.ProjectImageID)));
 }
 public static string GetCaptionOnGallery(this ProjectImage projectImage) =>
 $"{projectImage.Caption}\r\n(Timing: {projectImage.ProjectImageTiming.ProjectImageTimingDisplayName}) {projectImage.FileResourceInfo.GetFileResourceDataLengthString()}";
        public static string GetCaptionOnFullView(this ProjectImage projectImage)
        {
            var creditString = string.IsNullOrWhiteSpace(projectImage.Credit) ? string.Empty : $"\r\nCredit: {projectImage.Credit}";

            return($"{projectImage.GetCaptionOnGallery()}{creditString}");
        }
 public static string GetPhotoUrlScaledForPrint(this ProjectImage projectImage) => projectImage.FileResourceInfo.GetFileResourceUrlScaledForPrint();
 public static string GetPhotoUrlLargeScaledThumbnail(this ProjectImage projectImage) => projectImage.FileResourceInfo.FileResourceUrlScaledThumbnail(200);
 public static string GetPhotoUrl(this ProjectImage projectImage) => projectImage.FileResourceInfo.GetFileResourceUrl();
Пример #8
0
 public static void DeleteProjectImage(this IQueryable <ProjectImage> projectImages, ProjectImage projectImageToDelete)
 {
     DeleteProjectImage(projectImages, new List <ProjectImage> {
         projectImageToDelete
     });
 }