public static MediaFileViewModel GetViewModel(MediaFileInfo mediaFileInfo, IMediaFileUrlRetriever fileUrlRetriever) { return(new MediaFileViewModel { Guid = mediaFileInfo.FileGUID, Title = mediaFileInfo.FileTitle, Name = mediaFileInfo.FileName, RelativePath = fileUrlRetriever.Retrieve(mediaFileInfo).WithSizeConstraint(SizeConstraint.MaxWidthOrHeight(400)).RelativePath }); }
// Initializes instances of required services using dependency injection public MediaLibraryController(IMediaFileUrlRetriever mediaFileUrlRetriever, IMediaLibraryInfoProvider mediaLibraryInfoProvider, IMediaFileInfoProvider mediaFileInfoProvider, ISiteService siteService) { this.mediaFileUrlRetriever = mediaFileUrlRetriever; this.mediaLibraryInfoProvider = mediaLibraryInfoProvider; this.mediaFileInfoProvider = mediaFileInfoProvider; this.siteService = siteService; }
/// <summary> /// Creates an instance of <see cref="CardWidgetController"/> class. /// </summary> public CardWidgetController(IMediaFileRepository mediaFileRepository, IOutputCacheDependencies outputCacheDependencies, IComponentPropertiesRetriever componentPropertiesRetriever, IMediaFileUrlRetriever mediaFileUrlRetriever) { this.mediaFileRepository = mediaFileRepository; this.outputCacheDependencies = outputCacheDependencies; this.componentPropertiesRetriever = componentPropertiesRetriever; this.mediaFileUrlRetriever = mediaFileUrlRetriever; }
public SelectorsWidgetViewComponent(IPageAttachmentUrlRetriever attachmentUrlRetriever, IMediaFileInfoProvider mediaFileInfoProvider, IMediaFileUrlRetriever mediaFileUrlRetriever, ISiteService siteService) { this.attachmentUrlRetriever = attachmentUrlRetriever; this.mediaFileInfoProvider = mediaFileInfoProvider; this.mediaFileUrlRetriever = mediaFileUrlRetriever; this.siteService = siteService; }
public SelectorsWidgetController(IPageAttachmentUrlRetriever attachmentUrlRetriever, IComponentPropertiesRetriever propertiesRetriever, IMediaFileInfoProvider mediaFileInfoProvider, IMediaFileUrlRetriever mediaFileUrlRetriever, ISiteService siteService) { this.attachmentUrlRetriever = attachmentUrlRetriever; this.propertiesRetriever = propertiesRetriever; this.mediaFileInfoProvider = mediaFileInfoProvider; this.mediaFileUrlRetriever = mediaFileUrlRetriever; this.siteService = siteService; }
public MediaFileRepository( IMediaLibraryInfoProvider mediaLibraryInfoProvider, IMediaFileInfoProvider mediaFileInfoProvider, ISiteService siteService, IMediaFileUrlRetriever mediaFileUrlRetriever, IOptionsMonitor <XperienceOptions> optionsMonitor) { _mediaLibraryInfoProvider = mediaLibraryInfoProvider ?? throw new ArgumentNullException(nameof(mediaLibraryInfoProvider)); _mediaFileInfoProvider = mediaFileInfoProvider ?? throw new ArgumentNullException(nameof(mediaFileInfoProvider)); _siteService = siteService ?? throw new ArgumentNullException(nameof(siteService)); _mediaFileUrlRetriever = mediaFileUrlRetriever ?? throw new ArgumentNullException(nameof(mediaFileUrlRetriever)); _optionsMonitor = optionsMonitor ?? throw new ArgumentNullException(nameof(optionsMonitor)); }
/// <summary> /// Creates an instance of <see cref="CardWidgetViewComponent"/> class. /// </summary> /// <param name="mediaFileRepository">Repository for media files.</param> /// <param name="mediaFileUrlRetriever">The media file URL retriever.</param> public CardWidgetViewComponent(MediaFileRepository mediaFileRepository, IMediaFileUrlRetriever mediaFileUrlRetriever) { this.mediaFileRepository = mediaFileRepository; this.mediaFileUrlRetriever = mediaFileUrlRetriever; }
public MediaGalleryViewComponent(MediaFileRepository mediaFileRepository, IMediaFileUrlRetriever fileUrlRetriever) { this.mediaFileRepository = mediaFileRepository; this.fileUrlRetriever = fileUrlRetriever; }
public MediaController(IMediaFileRepository mediaFileRepository, IMediaFileUrlRetriever fileUrlRetriever) { this.mediaFileRepository = mediaFileRepository; this.fileUrlRetriever = fileUrlRetriever; }
/// <summary> /// Initializes a new instance of the <see cref="BannerWidgetViewComponent"/> class. /// </summary> /// <param name="mediaFileProvider">The media file provider.</param> /// <param name="fileUrlRetriever">The media file URL retriever.</param> public BannerWidgetViewComponent(IMediaFileInfoProvider mediaFileProvider, IMediaFileUrlRetriever fileUrlRetriever) { this.mediaFileProvider = mediaFileProvider; this.fileUrlRetriever = fileUrlRetriever; }