コード例 #1
0
        public OverlayViewModel(IOverlayService overlayService, IOverlayEntryProvider overlayEntryProvider,
                                IAppConfiguration appConfiguration, IEventAggregator eventAggregator)
        {
            _overlayService       = overlayService;
            _overlayEntryProvider = overlayEntryProvider;
            _appConfiguration     = appConfiguration;
            _eventAggregator      = eventAggregator;

            if (IsOverlayActive)
            {
                _overlayService.ShowOverlay();
            }

            IsRTSSInstalled     = !string.IsNullOrEmpty(RTSSUtils.GetRTSSFullPath());
            UpdateHpyerlinkText = "To use the overlay, install the latest" + Environment.NewLine +
                                  "RivaTuner  Statistics  Server  (RTSS)";

            OverlayEntries.AddRange(_overlayEntryProvider.GetOverlayEntries());

            SetGlobalHookEventOverlayHotkey();
            SetGlobalHookEventResetHistoryHotkey();
        }
コード例 #2
0
        public StateViewModel(IRecordDirectoryObserver recordObserver,
                              IEventAggregator eventAggregator,
                              IAppConfiguration appConfiguration,
                              ICaptureService captureService,
                              IOverlayService overlayService,
                              IUpdateCheck updateCheck,
                              IAppVersionProvider appVersionProvider,
                              IWebVersionProvider webVersionProvider)
        {
            _recordObserver      = recordObserver;
            _eventAggregator     = eventAggregator;
            _appConfiguration    = appConfiguration;
            _captureService      = captureService;
            _overlayService      = overlayService;
            _updateCheck         = updateCheck;
            _appVersionProvider  = appVersionProvider;
            IsDirectoryObserving = true;
            IsCaptureModeActive  = false;
            IsOverlayActive      = _appConfiguration.IsOverlayActive && !string.IsNullOrEmpty(RTSSUtils.GetRTSSFullPath());

            UpdateHyperlinkText = $"New version available on GitHub: v{webVersionProvider.GetWebVersion()}";

            _recordObserver.HasValidSourceStream
            .Subscribe(state => IsDirectoryObserving = state);

            _captureService.IsCaptureModeActiveStream
            .Subscribe(state => IsCaptureModeActive = state);

            _overlayService.IsOverlayActiveStream
            .Subscribe(state => IsOverlayActive = state);
        }