Below is what you said :
As I wrote earlier you have to detect whether the connection was changed.
e.Actions[0] is the new line
e.Actions[1] is the old Start docked element
e.Actions[2] is the old End docked element
All you have to do is to compare the newline.Start.DockedElement with e.Actions[1] and the same for the End element respectively. If they are all the same, the connection was not changed and you don't have to perform any special actions.
This line.Start.DockChanged and line.End.DockChanged events seems to be better (and they are not raised if you just move a line).
I didn't know about that. I am wondering if I can still restore the connection in that event. CanDock won't help me, because when I return false there and release the button on forbidden element the connection will be left unconnected on that element, which is not good for me. It should be restored to its previous state.
I do it by changing the connector.Start.Shape and connector.End.Shape, but will this DockChanged event be called then ?
It could cause a forever loop when changed from inside of this event, so maybe I should remove these event handler for a moment of restoring the line or is it safe ?
There is a stentence : "This line.Start.DockChanged and line.End.DockChanged events seems to be better", I just want to know how to use these events ?