public void Handle(SwapBuildingBlockEvent eventToHandle)
        {
            //we need to swap all template building blocks stored in the used building block nodes
            var simulationRootNode = _view.NodeByType(RootNodeTypes.SimulationFolder);
            var allNodesToUpdate   = simulationRootNode.AllLeafNodes.OfType <UsedBuildingBlockInSimulationNode>()
                                     .Where(n => Equals(n.TemplateBuildingBlock, eventToHandle.OldBuildingBlock))
                                     .ToList();

            allNodesToUpdate.Each(x => x.TemplateBuildingBlock = eventToHandle.NewBuildingBlock);
        }
Exemplo n.º 2
0
 public void Handle(SwapBuildingBlockEvent eventToHandle)
 {
     //need to remove the node of the old protocol when a protocol swap is happening as the normal remove building block event is not triggered
     RemoveNodeFor(eventToHandle.OldBuildingBlock);
 }