示例#1
0
 public void OnKeyEvent(object sender, Window.KeyEventArgs e)
 {
     if (e.Key.State == Key.StateType.Down && (e.Key.KeyPressedName == "XF86Back" || e.Key.KeyPressedName == "Escape"))
     {
         Exit();
     }
 }
示例#2
0
 /// <summary>
 /// Called when any key event is received.
 /// Will use this to exit the application if the Back or Escape key is pressed
 /// </summary>
 private void OnKeyEvent(object sender, Window.KeyEventArgs eventArgs)
 {
     if (eventArgs.Key.State == Key.StateType.Down)
     {
         switch (eventArgs.Key.KeyPressedName)
         {
         case "Escape":
         case "Back":
         {
             Exit();
         }
         break;
         }
     }
 }
示例#3
0
    void OnKeyEvent(object source, Window.KeyEventArgs e)
    {
        if (e.Key.State == Key.StateType.Down)
        {
            FullGC();
            //Streamline.AnnotateChannelEnd(0);

            switch (e.Key.KeyPressedName)
            {
            case "Escape":
            case "Back":
            {
                Deactivate();
                Exit();
            }
            break;
            }
        }
    }
 public void OnKeyEvent(object sender, Window.KeyEventArgs e)
 {
     if (e.Key.State == Key.StateType.Down)
     {
         if (e.Key.KeyPressedName == "1")
         {
             clickCount++;
             if ((clickCount) % 2 == 0)
             {
                 ThemeManager.ApplyTheme(themeBlack);
             }
             else
             {
                 ThemeManager.ApplyTheme(themeGreen);
             }
         }
         else if (e.Key.KeyPressedName == "XF86Back")
         {
             Exit();
         }
     }
 }