public void PasteFromLocalClipboard(SnippetTNode to) { // note that the PoppedUpNode does not have to be a value. It might be a "root" // node if (localClipboard == null || localClipboard.Contains(to)) return; // on move, clear the clipboard if (localClipboard.IsMove) { MoveNodes(localClipboard, to); Clipboard.SetDataObject(new SerializableUniverse()); // clear the clipboard, can't use null localClipboard = null; } else CopyNodes(localClipboard, to); }
private void CopyOrMove(bool move) { if (MenuPoppedUpNode == null || !SelectedNodes.Contains(MenuPoppedUpNode) || SelectedNodes.Count == 0) { string verb; if (move) verb = "cut"; else verb = "copied"; MessageBox.Show(this, "Nothing was " + verb + " to the clipboard. Right click one of the selected snippets.", MainForm.DialogCaption, MessageBoxButtons.OK); } else { localClipboard = new LocalClipboard(SelectedNodes, move); localClipboard.CopyToWindowsClipboard(); } }