Пример #1
0
        public ImageData ThumbnailImageData(string suffix)
        {
            string prependImageName = ConfigurationManager.AppSettings["PrependImageName"];

            return(new ImageData()
            {
                ID = ImageID, FileName = prependImageName + " " + Name + "_" + suffix + ".jpg", CanLightbox = ImageCanLightbox(ImageType),
                TypicalName = TypicalImageFiles.Any() ? TypicalImageFiles.First().Typical.Name : null
            });
        }
Пример #2
0
        public ImageFile.ImageData FeaturedImageForSize(string suffix)
        {
            var fImg = TypicalImageFiles.FirstOrDefault(i => i.IsFeatured);

            if (fImg != null)
            {
                return(fImg.ImageFile.ThumbnailImageData(suffix));
            }

            return(null);
        }
Пример #3
0
        public IEnumerable <ImageFile.ImageData> ImageListForSize(string suffix, int maxImageCount = 0)
        {
            var imgList = TypicalImageFiles
                          .Where(s => !s.IsFeatured);

            if ((maxImageCount > 0))
            {
                var randNum = new Random();
                imgList = imgList.OrderBy(i => randNum.Next()).Take(maxImageCount);
            }

            return(imgList.Select(i => i.ImageFile.ThumbnailImageData(suffix)));
        }