Exemple #1
0
        public PdfGenerator(
            IPdfOptionsService pdfOptionsService,
            IOptionsMonitor <PdfOptions> pdfOptionsMonitor,
            IOptionsMonitor <PdfGeneratorOptions> pdfGeneratorMonitor)
        {
            _pdfOptionsMonitor   = pdfOptionsMonitor;
            _pdgGeneratorOptions = pdfGeneratorMonitor.CurrentValue;

            pdfGeneratorMonitor.OnChange(o => _pdgGeneratorOptions = o);

            _pdfOptionsService = pdfOptionsService ?? throw new System.ArgumentNullException(nameof(pdfOptionsService));
        }
Exemple #2
0
        public OperatorViewModel(
            IMediaProviderService mediaProviderService,
            IThumbnailService thumbnailService,
            IMediaMetaDataService metaDataService,
            IOptionsService optionsService,
            IPageService pageService,
            IFolderWatcherService folderWatcherService,
            IMediaStatusChangingService mediaStatusChangingService,
            IHiddenMediaItemsService hiddenMediaItemsService,
            IActiveMediaItemsService activeMediaItemsService,
            IFrozenVideosService frozenVideosService,
            IPdfOptionsService pdfOptionsService,
            ISnackbarService snackbarService,
            IDialogService dialogService)
        {
            _mediaProviderService       = mediaProviderService;
            _mediaStatusChangingService = mediaStatusChangingService;

            _hiddenMediaItemsService = hiddenMediaItemsService;
            _hiddenMediaItemsService.UnhideAllEvent += HandleUnhideAllEvent;

            _snackbarService = snackbarService;
            _dialogService   = dialogService;

            _activeMediaItemsService = activeMediaItemsService;
            _frozenVideosService     = frozenVideosService;
            _pdfOptionsService       = pdfOptionsService;

            _thumbnailService = thumbnailService;
            _thumbnailService.ThumbnailsPurgedEvent += HandleThumbnailsPurgedEvent;

            _metaDataService = metaDataService;

            _optionsService = optionsService;
            _optionsService.MediaFolderChangedEvent               += HandleMediaFolderChangedEvent;
            _optionsService.AutoRotateChangedEvent                += HandleAutoRotateChangedEvent;
            _optionsService.AllowVideoPauseChangedEvent           += HandleAllowVideoPauseChangedEvent;
            _optionsService.AllowVideoPositionSeekingChangedEvent += HandleAllowVideoPositionSeekingChangedEvent;
            _optionsService.UseInternalMediaTitlesChangedEvent    += HandleUseInternalMediaTitlesChangedEvent;
            _optionsService.ShowMediaItemCommandPanelChangedEvent += HandleShowMediaItemCommandPanelChangedEvent;
            _optionsService.AllowMirrorChangedEvent               += HandleAllowMirrorChangedEvent;
            _optionsService.ShowFreezeCommandChangedEvent         += HandleShowFreezeCommandChangedEvent;
            _optionsService.OperatingDateChangedEvent             += HandleOperatingDateChangedEvent;
            _optionsService.MaxItemCountChangedEvent              += HandleMaxItemCountChangedEvent;
            _optionsService.PermanentBackdropChangedEvent         += async(sender, e) =>
            {
                await HandlePermanentBackdropChangedEvent(sender, e);
            };
            _optionsService.IncludeBlankScreenItemChangedEvent += async(sender, e) =>
            {
                await HandleIncludeBlankScreenItemChangedEvent(sender, e);
            };

            folderWatcherService.ChangesFoundEvent += HandleFileChangesFoundEvent;

            _pageService = pageService;
            _pageService.MediaChangeEvent          += HandleMediaChangeEvent;
            _pageService.SlideTransitionEvent      += HandleSlideTransitionEvent;
            _pageService.MediaMonitorChangedEvent  += HandleMediaMonitorChangedEvent;
            _pageService.MediaPositionChangedEvent += HandleMediaPositionChangedEvent;
            _pageService.MediaNearEndEvent         += async(sender, e) =>
            {
                await HandleMediaNearEndEvent(sender, e);
            };
            _pageService.NavigationEvent += HandleNavigationEvent;
            _pageService.WebStatusEvent  += HandleWebStatusEvent;

            LoadMediaItems();
            InitCommands();

            LaunchThumbnailQueueConsumer();

            Messenger.Default.Register <ShutDownMessage>(this, OnShutDown);
            Messenger.Default.Register <SubtitleFileMessage>(this, OnSubtitleFileActivity);
        }