I’m having so trouble to know where exactly I should put the code that updates my business model when the user makes some modifications in the graph. Here are my candidates:
In the GoDocument.OnChanged event. Apart from the fact that I could
not find any documentation that explains what I might find in the
parameters of this event depending on the hint/subhint, I’m afraid that
using this may make me enter into a bad loop: I get some external
update on my model, therefore I update the diagram, then I receive some
update notification, then I update my model again. Am I right ?
In the events of the GoView, for instance GoView.LinkRelinked. The problem is that I’m not sure those events get all the required data to perform the update. For instance, GoView.LinkRelinked get only one parameter, of type GoObject. I guess this object might be a GoLink (once again, the doc is rather elliptic), but in order to handle such an event, I also need to know where the link was connected before.
In the tools that enable me to make the changes. This feels rather clumsy, and error prone. You can never know for sure you have not forgotten one way the user might modify the diagram.
What would you advise me to do ? Is there anything I missed ?