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; } } }
private static void HandleDroppedInstance(object draggedObject, object targetObject) { InstanceSave draggedAsInstanceSave = draggedObject as InstanceSave; ElementSave targetElementSave = targetObject as ElementSave; if (targetElementSave == null && targetObject is InstanceSave) { targetElementSave = ((InstanceSave)targetObject).ParentContainer; } bool isSameElement = draggedAsInstanceSave != null && targetElementSave == draggedAsInstanceSave.ParentContainer; if (targetElementSave != null) { if (isSameElement) { HandleDroppingInstanceOnTarget(targetObject, draggedAsInstanceSave, targetElementSave); } else { List <InstanceSave> instances = new List <InstanceSave>() { draggedAsInstanceSave }; CopyPasteLogic.PasteInstanceSaves(instances, draggedAsInstanceSave.ParentContainer.DefaultState.Clone(), targetElementSave); } } }
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; //} } }