The objects generated using Liquid XML Objects can be cloned (deep copied) using the helper Serializer. Clone<T> Method. This produces a deep copy of the source object.
The source object must be an object generated with LXO (i.e. it must be attributed with LxElementDefinitionAttribute Class or LxCompositorDefinitionAttribute Class.
Example |
Copy Code
|
---|---|
using (XmlReader xmlReader = XmlReader.Create(@"MyXmlFile.xml")) { var myThing= serializer.Deserialize<MyXmlThing>(xmlReader); var myThingCopy = serializer.Clone(myThing); } |