I’m trying to do the following:
When a link is drawn, hit a web service to create some data. When the web service returns, add the link to the model. The link should not be added to the model until the web service returns.
I can’t quite seem to figure out how to do this. I saw LinkingTool.DoMouseUp, but I couldn’t figure out how to determine what the From and To nodes would be as well as whether or not a valid link could be drawn. Deriving my own class from LinkingTool and overriding DoMouseUp to first call base.DoMouseUp results in the link being added to the model – definitely not the behavior which I’m after.
The solution I’ve come up with is to handle the Diagram.LinkDrawn event, grab the Link from the DiagramEventArgs, examine its From/To, pass that data to my web service, and then immediately rollback the last transaction. This works, but seems like a terrible solution.