public ScreenshotExtensionPlugin(IPlayniteAPI playniteAPI) : base(playniteAPI)
        {
            _playniteAPI         = playniteAPI;
            _logger              = playniteAPI.CreateLogger();
            _globalHotkeyService = new GlobalHotkeyService(_logger);
            _settings            = new ScreenshotPluginSettings(this);

            _globalHotkeyService.HotkeyPress += GlobalHotkeyServiceOnHotkeyPress;
        }
 public void BeginEdit()
 {
     _before = new ScreenshotPluginSettings
     {
         CaptureActiveWindowHotkey  = CaptureActiveWindowHotkey,
         CaptureActiveMonitorHotkey = CaptureActiveMonitorHotkey,
         CaptureFullscreenHotkey    = CaptureFullscreenHotkey
     };
 }
        public void UpdateHotkeys([CanBeNull] ScreenshotPluginSettings before, ScreenshotPluginSettings after)
        {
            if (before != null)
            {
                _globalHotkeyService.UnregisterHotkey(before.CaptureFullscreenHotkey);
                _globalHotkeyService.UnregisterHotkey(before.CaptureActiveMonitorHotkey);
                _globalHotkeyService.UnregisterHotkey(before.CaptureActiveWindowHotkey);
            }

            _globalHotkeyService.RegisterHotkey(after.CaptureFullscreenHotkey);
            _globalHotkeyService.RegisterHotkey(after.CaptureActiveMonitorHotkey);
            _globalHotkeyService.RegisterHotkey(after.CaptureActiveWindowHotkey);
        }