public void DuplicateSelection() { if (Selected.Nodes.Any() || Selected.Groups.Any()) { var duplicates = m_copyPasteController.Duplicate(Selected.Nodes.Select(CurrentFile.GetNode), Selected.Groups, DataSource); var nodesAndGroups = CurrentFile.DuplicateInto(duplicates.Item1, duplicates.Item2, duplicates.Item3, m_localization); SetSelection(nodesAndGroups.Item1, nodesAndGroups.Item2); Redraw(); } }
public void Insert(Point?p, Tuple <IEnumerable <GraphAndUI <NodeUIData> >, IEnumerable <NodeGroup>, object, bool> additions) { Point loc = p ?? DrawWindowToGraphSpace(new Point(Width / 2, Height / 2)); Tuple <IEnumerable <TNode>, IEnumerable <NodeGroup> > nodesAndGroups; if (additions.Item4) { nodesAndGroups = CurrentFile.DuplicateInto(additions.Item1, additions.Item2, loc, m_localization); } else { nodesAndGroups = CurrentFile.InsertInto(additions.Item1, additions.Item2, loc, m_localization); } SetSelection(nodesAndGroups.Item1, nodesAndGroups.Item2); }