public void Undo()
        {
            _network.RowCount = _oldRowCount;
            var movedElements = _network.GetElements().Where(e => e.Y >= _startRow).ToList().OrderBy(x => { return(x.Y); }).Reverse();
            var movedVLines   = _network.GetVerticalLines().Where(e => e.Y >= _startRow).ToList().OrderBy(x => { return(x.Y); }).Reverse();

            foreach (var ele in movedElements)
            {
                _network.RemoveEle(ele.X, ele.Y);
                ele.Y += _count;
                _network.ReplaceEle(ele);
            }
            foreach (var vline in movedVLines)
            {
                _network.RemoveVLine(vline.X, vline.Y);
                vline.Y += _count;
                _network.ReplaceVLine(vline);
            }
            _network.ReplaceElements(_removedElements);
            _network.ReplaceVerticalLines(_removedVerticalLines);
            InstructionCommentManager.RaiseMappedMessageChangedEvent();
            if (_oldarea != null)
            {
                _oldarea.Select(_network);
            }
        }
        public void Undo()
        {
            _network.RowCount = _oldRowCount;
            var movedElements = _network.GetElements().Where(e => e.Y >= _rowNumber).ToList();
            var movedVLines   = _network.GetVerticalLines().Where(e => e.Y >= _rowNumber).ToList();

            foreach (var ele in movedElements)
            {
                _network.RemoveElement(ele);
                ele.Y++;
                _network.ReplaceElement(ele);
            }
            foreach (var vline in movedVLines)
            {
                _network.RemoveVerticalLine(vline);
                vline.Y++;
                _network.ReplaceVerticalLine(vline);
            }

            foreach (var ele in _removedElements)
            {
                _network.ReplaceElement(ele);
            }
            foreach (var vline in _removedVerticalLines)
            {
                _network.ReplaceVerticalLine(vline);
            }
            if (_oldarea != null)
            {
                _oldarea.Select(_network);
            }
        }
 public void Undo()
 {
     _network.ReplaceElements(_elements);
     _network.ReplaceVerticalLines(_vlines);
     InstructionCommentManager.RaiseMappedMessageChangedEvent();
     if (_area != null)
     {
         _area.Select(_network);
     }
 }
 public void Undo()
 {
     _ladderDiagram.AddNetwork(_removedNetworks, _index, true);
     _ladderDiagram.IDVModel.Setup(_ladderDiagram);
     _ladderDiagram.UpdateModelMessageByNetwork();
     if (_area != null)
     {
         LadderNetworkViewModel lnvmodel = _removedNetworks.First();
         _area.Select(lnvmodel);
     }
 }
 public void Undo()
 {
     ldvmodel.RemoveNetwork(lnvmodel);
     ldvmodel.AddNetwork(lnvmodel, number_old);
     ldvmodel.IDVModel.Setup(ldvmodel);
     ldvmodel.UpdateModelMessageByNetwork();
     if (area_old != null)
     {
         area_old.Select(lnvmodel);
     }
 }
 public void Execute()
 {
     ldvmodel.RemoveNetwork(lnvmodel);
     ldvmodel.AddNetwork(lnvmodel, number_new - (number_new > number_old ? 1 : 0));
     ldvmodel.IDVModel.Setup(ldvmodel);
     ldvmodel.UpdateModelMessageByNetwork();
     if (area_new != null)
     {
         area_new.Select(lnvmodel);
     }
 }
 public virtual void Undo()
 {
     _network.RowCount = _oldRowCount;
     _network.RemoveElements(_elements);
     _network.RemoveVerticalLines(_vlines);
     _network.ReplaceElements(_oldelements);
     _network.ReplaceVerticalLines(_oldvlines);
     InstructionCommentManager.RaiseMappedMessageChangedEvent();
     _oldarea?.Select(_network);
     if (_oldarea == null)
     {
         _area?.Select(_network);
     }
 }
Exemple #8
0
 public void Undo()
 {
     foreach (var bp in _newbreakpoints)
     {
         _network.RemoveBreakpoint(bp);
     }
     foreach (var bp in _oldbreakpoints)
     {
         _network.ReplaceBreakpoint(bp);
     }
     if (_oldarea != null)
     {
         _oldarea.Select(_network);
     }
 }
 public void Undo()
 {
     _ladderDiagram.AddNetwork(_removedNetworks, _index, true);
     _ladderDiagram.RemoveNetworks(_replacedNetworks);
     _ladderDiagram.IDVModel.Setup(_ladderDiagram);
     _ladderDiagram.ClearModelMessageByNetwork(_replacedNetworks);
     _ladderDiagram.UpdateModelMessageByNetwork();
     if (_removedNetworks.Count() > 0)
     {
         _oldarea = NetworkChangeElementArea.Create(
             _ladderDiagram, _removedNetworks);
         LadderNetworkViewModel lnvmodel = _removedNetworks.First();
         _oldarea.Select(lnvmodel);
     }
 }
        public virtual void Execute()
        {
            _oldRowCount = _network.RowCount;
            int tempRowCount = ComputeRowCount();

            if (_network.RowCount < tempRowCount)
            {
                _network.RowCount = tempRowCount;
            }
            _network.RemoveElements(_oldelements);
            _network.RemoveVerticalLines(_oldvlines);
            _network.ReplaceElements(_elements);
            _network.ReplaceVerticalLines(_vlines);
            InstructionCommentManager.RaiseMappedMessageChangedEvent();
            if (_area != null)
            {
                _area.Select(_network);
            }
        }