开发者

IDeserializationCallback in XMLSrializer

Is开发者_运维问答 there a way to utilize the IDeserializationCallback interface with the standard xmlSerializer? It does not appear to be supported in this context.

IDeserializationCallback works fine when used with the binary formatters.

Basicaly i want to do some calculation when de-serialization e.g.:

public void IDeserializationCallback.OnDeserialization(Object sender)
{
    // After deserialization, calculate the age.
    Age = System.DateTime.Now.Year - (DOB.Year + 1);
}


No, this interface is not used by the XmlSerializer.


Use IXmlSerializable instead.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜