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 void Execute() { _ladderDiagram.SetMaskNumber(); _ladderDiagram.AddNetwork(_replacedNetworks, _index, false); _ladderDiagram.RemoveNetworks(_removedNetworks); _ladderDiagram.IDVModel.Setup(_ladderDiagram); _ladderDiagram.ClearModelMessageByNetwork(_removedNetworks); _ladderDiagram.UpdateModelMessageByNetwork(); if (_replacedNetworks.Count() > 0) { _area = NetworkChangeElementArea.Create( _ladderDiagram, _replacedNetworks); LadderNetworkViewModel lnvmodel = _replacedNetworks.First(); _area.Select(lnvmodel); } }
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 Execute() { int oldnum = _sourceNetwork.NetworkNumber, newnum = _desNetwork.NetworkNumber; if (oldnum < newnum) { _ladderDiagram.RemoveNetwork(_desNetwork); _ladderDiagram.AddNetwork(_desNetwork, oldnum); _ladderDiagram.RemoveNetwork(_sourceNetwork); _ladderDiagram.AddNetwork(_sourceNetwork, newnum); } else { _ladderDiagram.RemoveNetwork(_sourceNetwork); _ladderDiagram.AddNetwork(_sourceNetwork, newnum); _ladderDiagram.RemoveNetwork(_desNetwork); _ladderDiagram.AddNetwork(_desNetwork, oldnum); } _ladderDiagram.IDVModel.Setup(_ladderDiagram); _ladderDiagram.UpdateModelMessageByNetwork(); }