Beispiel #1
0
 public void SaveWindowPos()
 {
     if (IsWindowed)
     {
         _optionsService.MediaWindowPlacement = this.GetPlacement();
         _optionsService.Save();
     }
 }
Beispiel #2
0
        public MainViewModel(
            IPageService pageService,
            IOptionsService optionsService,
            ISnackbarService snackbarService,
            IMediaStatusChangingService mediaStatusChangingService,
            IHiddenMediaItemsService hiddenMediaItemsService,
            ICommandLineService commandLineService,
            IDragAndDropService dragAndDropService)
        {
            _commandLineService = commandLineService;
            
            if (commandLineService.NoGpu || ForceSoftwareRendering())
            {
                // disable hardware (GPU) rendering so that it's all done by the CPU...
                RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;
            }

            Messenger.Default.Register<MediaListUpdatingMessage>(this, OnMediaListUpdating);
            Messenger.Default.Register<MediaListUpdatedMessage>(this, OnMediaListUpdated);

            _mediaStatusChangingService = mediaStatusChangingService;
            _hiddenMediaItemsService = hiddenMediaItemsService;

            _hiddenMediaItemsService.HiddenItemsChangedEvent += HandleHiddenItemsChangedEvent;

            _pageService = pageService;
            _pageService.NavigationEvent += HandlePageNavigationEvent;
            _pageService.MediaMonitorChangedEvent += HandleMediaMonitorChangedEvent;
            _pageService.MediaWindowVisibilityChanged += HandleMediaWindowVisibilityChangedEvent;
            
            _snackbarService = snackbarService;
            
            _optionsService = optionsService;
            _optionsService.AlwaysOnTopChangedEvent += HandleAlwaysOnTopChangedEvent;

            if (_optionsService.ShouldPurgeBrowserCacheOnStartup)
            {
                _optionsService.ShouldPurgeBrowserCacheOnStartup = false;
                _optionsService.Save();
                FileUtils.DeleteBrowserCacheFolder();
            }

            _pageService.GotoOperatorPage();

            dragAndDropService.CopyingFilesProgressEvent += HandleCopyingFilesProgressEvent;

            InitCommands();

            if (!IsInDesignMode)
            {
                _pageService.InitMediaWindow();
            }

            GetVersionData();
            CheckLogLevel();
        }
Beispiel #3
0
 public void SaveWindowPos()
 {
     _optionsService.Options.CountdownOutputWindowPlacement = this.GetPlacement();
     _optionsService.Options.CountdownWindowSize            = new Size(Width, Height);
     _optionsService.Save();
 }
Beispiel #4
0
 private void StorePathOfUnfinishedRecording(RecordingStatusChangeEventArgs args)
 {
     _optionsService.Options.UnfinishedRecordingTempPath  = args.TempRecordingPath;
     _optionsService.Options.UnfinishedRecordingFinalPath = args.FinalRecordingPath;
     _optionsService.Save();
 }