From: Martin C. <mar...@ei...> - 2004-10-20 14:50:58
|
Hi Francois, I'm getting there on the GraphML, I've only concentrated on serializing the info for the moment, but with the approach I've taken I don't think deserialization will be too difficult. Problem with XML/GraphML is everything has to be text, lots of ToString() on fields/properties (which may need to be overridden). I wanted to run my implementation by you, before I go any further. Here goes: I've created a new Attribute in the Netron.Graphlib.Attributes namespace called GraphMLData, which is used to tag all Properties that need to be persisted. As I walk the GraphAbstract collections I pass the objects to a static member function of the GraphMLDataAttribute which builds the key/data pairs necessary for GraphML. Mmmm... It's kind of difficult to explain in an email. Can I send you the code? I can put it into CVS as everything compiles and so far as I can tell works ok. There are quite a few new supporting classes added into the Netron.Graphlib.IO namespace. To use the Serialization you only need a few lines of code in your app: XmlTextWriter tw = new XmlTextWriter("MyFile.xml",Encoding.Unicode); GraphMLSerializer g = new GraphMLSerializer(); g.Serialize(tw,graphControl1.Abstract); tw.Close(); I'll be on IM this evening if you want to chat. Look forward to your reply. Regards, Martin |