public void CopyMultiSelected(int dx, int dy) { ArrayList tmpList = new ArrayList(); foreach (Ele elem in List) { if (elem.selected) { Ele eL = elem.Copy(); elem.selected = false; eL.Move(dx, dy); tmpList.Add(eL); // sRec = new SelRect(eL); selEle = eL; selEle.EndMoveRedim(); } } foreach (Ele tmpElem in tmpList) { List.Add(tmpElem); // Uloz operaci do undo/redo bufferu StoreDo("I", tmpElem); } }
// Kopiruje oznaceny objekt, oznaci ho jako vybrany public void CopySelected(int dx, int dy) { if (selEle != null) { Ele L = CpSelected(); L.Move(dx, dy); DeSelect(); List.Add(L); // uklada operaci do undo/redo bufferu StoreDo("I", L); sRec = new SelRect(L); //sRec.sonoUnaLinea = L.sonoUnaLinea; selEle = L; selEle.EndMoveRedim(); } }