private void SettingsHotKey_Pressed(object sender, TokenManagerHotkeysEventArgs e)
 {
     if (Model.GetSettingsEnabled())
     {
         Program.ApplicationContext.Show();
         e.Handled = true;
     }
 }
Exemple #2
0
 private static void HotkeyHandler(object sender, HotkeyEventArgs e)
 {
     if (IsRegistered(e.Name))
     {
         TokenManagerHotkeysEventArgs eventArgs = e;
         RegisteredHotkeys[eventArgs.Name].Handler?.Invoke(sender, eventArgs);
         e.Handled = eventArgs.Handled;
     }
 }
 private void InsertToken(object sender, TokenManagerHotkeysEventArgs e)
 {
     if (Model.GetSettingsEnabled() && Model.GetProviderEnabled(Name) && !textBoxHotKeys.Focused)
     {
         string token = Model.ExtractProviderToken(e.Name);
         if (!string.IsNullOrWhiteSpace(token))
         {
             RevertChanges();
             Model.Save();
             SendKeys.Send(token);
             Clipboard.SetText(token);
             ShowTokenCopy(Name, token);
             CheckForLowTokenCount();
         }
         else
         {
             ShowNoTokensError();
         }
         e.Handled = true;
     }
 }