Пример #1
0
 private void SettingsHotKey_Pressed(object sender, TokenManagerHotkeysEventArgs e)
 {
     if (Model.GetSettingsEnabled())
     {
         Program.ApplicationContext.Show();
         e.Handled = true;
     }
 }
Пример #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;
     }
 }
Пример #3
0
 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;
     }
 }