.net-3.5netdatacontractserializer

Is there a way to signalize an object its successful deserialization?


I'm using NetDataContractSerializer. After successfully deserializing an object, is there a way to tell the object to finish its construction? I'm thinking along the lines of:

[DataContract]
class Foo
{
    [DataMember]
    int i;

    [SerializationCompletedEvent]
    void SerializationCompleted ()
    {
        i = i + 7;
    }
}

Solution

  • Found it out myself by now.

    http://msdn.microsoft.com/en-us/library/system.runtime.serialization.ondeserializedattribute.aspx

    Someone missed an easy 15 points I guess?