private void ExpressionTextBox_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         EnterPressed?.Execute(null);
     }
 }
示例#2
0
 public override void KeyDown(KeyEventArgs args)
 {
     if (args.KeyCode.IsSet(Keys.A) && args.Control)
     {
         SelectAll();
     }
     else if (args.KeyCode.IsSet(Keys.C) && args.Control)
     {
         Copy();
     }
     else if (args.KeyCode.IsSet(Keys.X) && args.Control)
     {
         Cut();
     }
     else if (args.KeyCode.IsSet(Keys.V) && args.Control)
     {
         Paste();
     }
     else if (args.KeyCode.IsSet(Keys.Z) && args.Control)
     {
         Undo();
     }
     else if (args.KeyCode.IsSet(Keys.Y) && args.Control)
     {
         Redo();
     }
     else if (args.KeyCode.IsSet(Keys.Right))
     {
         MoveRight(args);
     }
     else if (args.KeyCode.IsSet(Keys.Left))
     {
         MoveLeft(args);
     }
     else if (args.KeyCode.IsSet(Keys.Up))
     {
         MoveUp(args);
     }
     else if (args.KeyCode.IsSet(Keys.Down))
     {
         MoveDown(args);
     }
     else if (args.KeyCode.IsSet(Keys.Delete))
     {
         Delete(args);
     }
     else if (args.KeyCode.IsSet(Keys.Back))
     {
         Backspace(args);
     }
     else if (args.KeyCode == Keys.Home)
     {
         Home(args);
     }
     else if (args.KeyCode == Keys.End)
     {
         End(args);
     }
     else if (args.KeyCode.IsSet(Keys.Enter))
     {
         if (SpecialEnter && !args.Shift && !m_dropDownOpen)
         {
             args.Handled          = true;
             args.SuppressKeyPress = true;
             EnterPressed.Execute();
         }
     }
 }