This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
At present all my diagrams create a connection of type DiagramConnection. I can create a new I can inherit from DiagramConnection to create custom connection type, but how can i tell my diagram to use this new connection type by default? Thanks in advance |
|
|
Hello Start by creating a class that implements the IDiagramConnectionBuilder interface. This has 2 methods you need to implement. The CanCreateConnection method is for providing connection validation logic for limiting how a user can use the connection. If you don't need any logic for your custom connection, then this method should just return true. In the CreateConnection method, create an instance of your custom connection and pass in the fromConnectionPoint and toConnectionPoint parameters. Then use diagram.Connections.Add to add your custom connection to the given diagram. Now to set your custom connection as the default connection, Set the DefaultConnectionBuilder property of the diagram to be an instance of the custom connection builder. - Jason |
|