Exemplo n.º 1
0
        protected override async Task OnDeactivateAsync(bool close, CancellationToken cancellationToken)
        {
            if (_options.SaveLastInfoWindowPosition)
            {
                _options.LeftPosition = LeftPosition;
                _options.TopPosition  = TopPosition;
                await _jsonFileManager.SaveAsync(_options, "options");
            }

            await base.OnDeactivateAsync(close, cancellationToken);
        }
Exemplo n.º 2
0
        public async void OnPreviewKeyDown(object sender, KeyEventArgs e)
        {
            e.Handled = true;

            var key           = e.ImeProcessedKey == Key.None ? e.Key : e.ImeProcessedKey;
            var activationKey = KeyInterop.VirtualKeyFromKey(key);

            if (_applicationModel.SetActivationKey(activationKey))
            {
                await _jsonSavefileManager.SaveAsync(_options, AppConstants.OPTION_SAVE_NAME);

                NotifyOfPropertyChange(() => ActivationKey);

                return;
            }

            CustomMessageDialog dialog = new CustomMessageDialog("This key is already registered in switchkey table!");

            dialog.ShowDialog();
        }
 public async Task SaveTableAsync()
 {
     await _jsonSavefileManager.SaveAsync(SwitchKeyTable, "profile_switch_key_table").ConfigureAwait(false);
 }
Exemplo n.º 4
0
 public async Task SaveProfileAsync(HotkeyProfile profile)
 {
     await _jsonSavefileManager.SaveAsync(profile, $"profile{profile.ProfileNum}").ConfigureAwait(false);
 }