Exemplo n.º 1
0
        public override HistoryMemento OnExecute(IHistoryWorkspace historyWorkspace)
        {
            CompoundHistoryMemento chm = new CompoundHistoryMemento(this.historyName, this.undoImage);

            if (!historyWorkspace.Selection.IsEmpty)
            {
                DeselectFunction df = new DeselectFunction();
                EnterCriticalRegion();
                HistoryMemento hm = df.Execute(historyWorkspace);
                chm.PushNewAction(hm);
            }

            FlipLayerHistoryMemento flha = new FlipLayerHistoryMemento(
                null,
                null,
                historyWorkspace,
                this.layerIndex,
                this.flipType);

            EnterCriticalRegion();
            HistoryMemento flha2 = flha.PerformUndo();

            chm.PushNewAction(flha);

            return(chm);
        }
Exemplo n.º 2
0
        public override HistoryMemento OnExecute(IHistoryWorkspace historyWorkspace)
        {
            CompoundHistoryMemento memento = new CompoundHistoryMemento(this.historyMementoName, this.historyMementoImage);

            if (!historyWorkspace.Selection.IsEmpty)
            {
                DeselectFunction function = new DeselectFunction();
                base.EnterCriticalRegion();
                HistoryMemento memento4 = function.Execute(historyWorkspace);
                memento.AddMemento(memento4);
            }
            FlipLayerHistoryMemento newHA = new FlipLayerHistoryMemento(null, null, historyWorkspace, this.layerIndex, this.flipType);

            base.EnterCriticalRegion();
            HistoryMemento memento3 = newHA.PerformUndo(null);

            memento.AddMemento(newHA);
            return(memento);
        }
Exemplo n.º 3
0
        public override HistoryMemento OnExecute(IHistoryWorkspace historyWorkspace)
        {
            List <HistoryMemento> actions = new List <HistoryMemento>();

            if (!historyWorkspace.Selection.IsEmpty)
            {
                DeselectFunction da = new DeselectFunction();
                EnterCriticalRegion();
                HistoryMemento hm = da.Execute(historyWorkspace);
                actions.Add(hm);
            }

            int count = historyWorkspace.Document.Layers.Count;

            for (int i = 0; i < count; ++i)
            {
                HistoryMemento memento = new FlipLayerHistoryMemento(this.historyName, undoImage, historyWorkspace, i, flipType);
                EnterCriticalRegion();
                HistoryMemento mementoToAdd = memento.PerformUndo();
                actions.Add(mementoToAdd);
            }

            return(new CompoundHistoryMemento(this.historyName, undoImage, actions));
        }