Automatically reroute the connector when connecting 2 shapes

Applies to: Nevron Diagram for .NET

How to automatically reroute the connector when connecting 2 shapes?

When connecting 2 shapes with Dynamic HV, Dynamic Polyline or Dynamic Curve, you can capture the connect event and automatically reroute the connector.

You need to subscribe for the document.EventSinkService.Connected event. The arguments of the event have two GUIDs - one for each of the connection points involved in the connection. To get the connection points use the document.GetElementFromUniqueId method. To get the shape from the connection point use the Shape property of the connection point. To reroute the connector shape cast to INRoutableShape and if the cast succeeds call the Reroute() method.

Article ID: 4, Created On: 9/24/2010, Modified: 11/15/2010