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
|
Hi,
How can I get notified when connection is relocated? I've found out that I can implement IDiagramConnectionRelocator by inheriting DefaultDiagramConnectionRelocator. In this class I can override property CanRelocateConnection which can help implement validation login, but I haven't found method or an event which is called when connection is actually updated.
Thanks in advance for response.
Regards, Peter |
|
|
Hello Peter Here are two solutions for you: 1. Instead of extending DefaultDiagramConnectionRelocator, you could implement the IDiagramConnectionRelocator interface. Here you will need to implement the CanRelocateConnection method like you mentioned, and also the RelocateConnection method. Here is the code used by the default connection relocator to put in the RelocateConnection method:
info.Connection.FromConnectionPoint = info.NewSource; After these 2 lines of code, you know that the connection relocation has been performed, and you can put what ever other logic you want here. The ConnectionRelocationInfo parameter to this method contains the diagram model, the connection being relocated, and also the original/new connection points at both ends of the connection. 2. I have now made the RelocateConnection method in the DefaultDiagramConnectionRelocator to be virtual. If you download the nightly build tomorrow the 27th of May, you can then override this method. Just include your additional logic after making a base call to the method in the default relocator. Hope this helps. Regards |
|