Method TreeBase<T>.XmlSave(+ 1 overload)
Overload
Saves tree of nodes (this and descendants) to an XML file.
protected void XmlSave(string file, TreeBase<T>.XmlNodeWriter nodeWriter, XmlWriterSettings sett = null, IEnumerable<T> children = null)
Parameters
|
file (string)
XML file. Must be full path. Can contain environment variables etc, see pathname.expand. |
|
nodeWriter (TreeBase<T>.XmlNodeWriter)
Callback function that writes node's XML start element (see System.Xml.XmlWriter.WriteStartElement) and attributes (see System.Xml.XmlWriter.WriteAttributeString). Must not write children and end element. Also should not write value, unless your reader knows how to read it. |
|
sett (XmlWriterSettings)
XML formatting settings. Optional. |
|
children (IEnumerable<T>)
If not |
Exceptions
|
ArgumentException
Not full path. |
|
Exception
Exceptions of System.Xml.XmlWriter.Create and other System.Xml.XmlWriter methods. |
Remarks
Uses filesystem.save. It ensures that existing file data is not damaged on exception etc.
Examples
Overload(top)
Writes tree of nodes (this and descendants) to an System.Xml.XmlWriter.
protected void XmlSave(XmlWriter x, TreeBase<T>.XmlNodeWriter nodeWriter, IEnumerable<T> children = null)
Parameters
| x (XmlWriter) |
|
nodeWriter (TreeBase<T>.XmlNodeWriter)
Callback function that writes node's XML start element (see System.Xml.XmlWriter.WriteStartElement) and attributes (see System.Xml.XmlWriter.WriteAttributeString). Must not write children and end element. Also should not write value, unless your reader knows how to read it. |
|
children (IEnumerable<T>)
If not |
Exceptions
|
Exception
Exceptions of System.Xml.XmlWriter methods. |