IXmlSerializationSurrogateDeserialize Method |
Deserialize an object from XML.
Namespace: Altaxo.Serialization.XmlAssembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3448.0 (4.8.3448.0)
SyntaxObject? Deserialize(
Object? o,
IXmlDeserializationInfo info,
Object? parentobject
)
Parameters
- o Object
- This is null except when a base type is deserialized; in that case it is the instance of the super class to populate.
- info IXmlDeserializationInfo
- The deserialization info used to read values from the XML input.
- parentobject Object
- The parent object in the object hierarchy which was deserialized before the current object; may be null for top-level objects.
Return Value
ObjectThe deserialized object instance.
RemarksAll deserialization code should check if object
o is null. In this case it has to create an instance of the class which is about to
be deserialized. If it is not null, the deserialization code of a super class has already created an instance. In this case the code must
use that instance. It is recommended to use the following pattern (except for abstract and sealed classes):
public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
{
var s = o as Foo ?? new Foo();
}
See Also