IDeserializationCallback vs OnDeserializedAttribute

前端 未结 4 2367
小蘑菇
小蘑菇 2021-02-19 10:45

As far as I understand, the IDeserializationCallback interface and the OnDeserialized event can both be used when an object needs to perform some task after being deserialized.<

4条回答
  •  猫巷女王i
    2021-02-19 11:16

    Those two serve different purposes and cannot be used interchangeably. In most of the cases you probably will be better served by the interface.

    Look here for some explanation: http://social.msdn.microsoft.com/Forums/en-US/netfxremoting/thread/311b2b57-6b0a-49ed-aa96-84f69d51da0f

提交回复
热议问题