Store link in XML format


I can store nodes in XML file but can u plz tell me how to store links in XML file?

Basically you just need to save information sufficient to identify both the link’s FromPort and the link’s ToPort, as well as any other properties that you care to save (i.e. properties that may vary amongst the links and that you do not want computed by your application or by GoDiagram).

When there is just one port per node, identifying the node is good enough to be able to find the port. When there might be more than one port on a node, you will need to save both the node identification as well as information to identify the particular port on that node.
There are lots of examples of this in the sample applications, of course, since they save both nodes and links. Most of them depend on GoDocument.MaintainsPartID being true, so that GoDiagram automatically assigns unique integer identifiers to each IGoIdentifiablePart -- basically each GoNode, GoPort, and GoLink.