示例#1
0
 void HandleCopyCutPaste(KeyEventArgs e)
 {
     if ((e.Modifiers & Keys.Control) == Keys.Control)
     {
         // copy, ctrl c, ctrl + c
         if (e.KeyCode == Keys.C)
         {
             CopyPasteLogic.OnCopy(CopyType.InstanceOrElement);
             e.Handled          = true;
             e.SuppressKeyPress = true;
         }
         // paste, ctrl v, ctrl + v
         else if (e.KeyCode == Keys.V)
         {
             CopyPasteLogic.OnPaste(CopyType.InstanceOrElement);
             e.Handled          = true;
             e.SuppressKeyPress = true;
         }
         // cut, ctrl x, ctrl + x
         else if (e.KeyCode == Keys.X)
         {
             CopyPasteLogic.OnCut(CopyType.InstanceOrElement);
             e.Handled          = true;
             e.SuppressKeyPress = true;
         }
     }
 }
示例#2
0
 private void HandleCopyCutPasteState(KeyEventArgs e)
 {
     if ((e.Modifiers & Keys.Control) == Keys.Control)
     {
         // copy, ctrl c, ctrl + c
         if (e.KeyCode == Keys.C)
         {
             CopyPasteLogic.OnCopy(CopyType.State);
             e.Handled          = true;
             e.SuppressKeyPress = true;
         }
         // paste, ctrl v, ctrl + v
         else if (e.KeyCode == Keys.V)
         {
             CopyPasteLogic.OnPaste(CopyType.State);
             e.Handled          = true;
             e.SuppressKeyPress = true;
         }
         //// cut, ctrl x, ctrl + x
         //else if (e.KeyCode == Keys.X)
         //{
         //    EditingManager.Self.OnCut(CopyType.Instance);
         //    e.Handled = true;
         //    e.SuppressKeyPress = true;
         //}
     }
 }