コード例 #1
0
        private void OnDiagramChanged(DiagramEventBase diagramEvent)
        {
            switch (diagramEvent)
            {
            case DiagramNodeAddedEvent diagramNodeAddedEvent:
                EnqueueDiagramAction(new AddDiagramNodeAction(diagramNodeAddedEvent.DiagramNode));
                break;

            case DiagramConnectorAddedEvent diagramConnectorAddedEvent:
                EnqueueDiagramAction(new AddDiagramConnectorAction(diagramConnectorAddedEvent.DiagramConnector));
                break;

            case DiagramNodeSizeChangedEvent diagramNodeSizeChangedEvent:
                var diagramNode = diagramNodeSizeChangedEvent.DiagramNode;
                EnqueueDiagramAction(new ResizeDiagramNodeAction(diagramNode, diagramNode.Size));
                break;

            case DiagramNodeRemovedEvent diagramNodeRemovedEvent:
                EnqueueDiagramAction(new RemoveDiagramNodeAction(diagramNodeRemovedEvent.DiagramNode));
                break;

            case DiagramConnectorRemovedEvent diagramConnectorRemovedEvent:
                EnqueueDiagramAction(new RemoveDiagramConnectorAction(diagramConnectorRemovedEvent.DiagramConnector));
                break;

            case DiagramClearedEvent _:
                _incrementalLayoutEngine.Clear();
                break;
            }
        }
コード例 #2
0
 public override void Clear()
 {
     _incrementalLayoutEngine.Clear();
     base.Clear();
 }