Exemplo n.º 1
0
        private void _Paste()
        {
            if (!(Selection is LayerData || Selection is GeometricObjectDataBase))
            {
                return;
            }
            if (Clipboard == null)
            {
                return;
            }

            EnableUndoRedoStoring = false;

            GeometricObjectDataBase obj = Clipboard.DeepClone() as GeometricObjectDataBase;
            LayerData target            = SelectedLayer;

            target.GeometricObjects.Add(obj);
            Action       undo   = () => { target.GeometricObjects.Remove(obj); };
            Action       redo   = () => { target.GeometricObjects.Add(obj); };
            UndoRedoPair urPair = new UndoRedoPair(new UndoRedoPairString(CurrentLanguage.StandardFunction.Paste + " : " + obj.Name, ""), undo, redo);

            EnableUndoRedoStoring = true;
            AddUndoRedoPair(urPair);

            ValidateProject(DoesUpdateShapeAuto);
        }