コード例 #1
0
 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
     });
 }
コード例 #2
0
 // 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;
 }
コード例 #3
0
 /// <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;
 }
コード例 #4
0
 public SelectorsWidgetViewComponent(IPageAttachmentUrlRetriever attachmentUrlRetriever,
                                     IMediaFileInfoProvider mediaFileInfoProvider,
                                     IMediaFileUrlRetriever mediaFileUrlRetriever,
                                     ISiteService siteService)
 {
     this.attachmentUrlRetriever = attachmentUrlRetriever;
     this.mediaFileInfoProvider  = mediaFileInfoProvider;
     this.mediaFileUrlRetriever  = mediaFileUrlRetriever;
     this.siteService            = siteService;
 }
コード例 #5
0
 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;
 }
コード例 #6
0
 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));
 }
コード例 #7
0
 /// <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;
 }
コード例 #8
0
 public MediaGalleryViewComponent(MediaFileRepository mediaFileRepository, IMediaFileUrlRetriever fileUrlRetriever)
 {
     this.mediaFileRepository = mediaFileRepository;
     this.fileUrlRetriever    = fileUrlRetriever;
 }
コード例 #9
0
 public MediaController(IMediaFileRepository mediaFileRepository, IMediaFileUrlRetriever fileUrlRetriever)
 {
     this.mediaFileRepository = mediaFileRepository;
     this.fileUrlRetriever    = fileUrlRetriever;
 }
コード例 #10
0
 /// <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;
 }