If I got 5 layers in a document, how can I save additional information about this layers, like a custom color I use for objects placed on the layers and the position if i read the layers information.
That looks right. You have to write the corresponding “Consume” code.
I am not sure If I express myself corrent, these properties does not exist in Golayer:
You’ll need to store those properties in your own objects that you associate with each GoLayer as part of your GoDocument.
Also, XmlWriter.WriteAttributeString only takes String values, so I don’t think the code you suggest would compile. You need to convert the values into strings. Remember to consider the current culture (or not!) when you do so.
I suggest that you use GoXml instead of System.Xml directly. GoXmlTransformer provides a bunch of methods that offer standard ways of converting various data types to strings for both writing and reading.
Better yet, use GoXmlBindingTransformer, new in version 3, for an even more declarative way of saying what you want. But you’ll still need to store additional per-layer information in a separate data structure.