Persisting custom diagram data

Persisting custom diagram data.

I have seen the similar Topic = object by Author = Segers Geert on persisting custom data using the String Data property.

I want to do something similar.

1) I make my own structures in memory that I use with a displayed diagram.
I want to save those structures out to disk. Then when the user loads a diagram they are read back off disk into memory.
Is there a place in the diagram that I can save that data?
Note - the data is not for any specific block in the diagram

2) When the user clicks the Menu = File and either Menu Item = "Open diagram" or  "Save diagram".
Is there a way I can tell if the user has done this?
Are there events like BeforeOpen, AfterOpen, BeforeSave, AfterSave?

Regards,
  Peter Evans



Hello Peter,

 
1. If there are no info related to block, but the diagram itself, I just recommend you build a custom file type and save your additional data together with diagram. For example, save diagram data, and right after save your custom data. I don't see a reason for adding such specific functionality in diagram. Alternatively you can just inherit from TatDiagram and add additional published properties in that new class.
 
2. Unfortunately there are no such events.