DotNet Visual Basic: IDeserializationCallback

  • sstory / 206 / Sun, 05 Apr 2009 11:32:00 GMT / Comments (0)
  • In Jeffrey Richters article on Serialization--part 2 from MSDN 2002, he
    mentions that "IDeserializationCallback....When this method is called, all
    objects have had their fields set. But there's no way to tell what order
    multiple objects have their OnDeserialization called. so, while the fields
    may be initialized, you still don't know if a referenced object is
    completely deserialized if that referenced object also implements the
    IDeserializationCallback interface."

    I have a form that has a specific collection class as a private member.
    The objects in that collection have a member variable that references the
    form on which the collection class is.
    After deserialization, I need to reset this member variable.

    How can I best do it?

    If I can't trust IDeserializationCallback, is there a way to call the
    deserialization for the collection on the form, and the code not continue
    executing until this call is made, and thus after the call comes back, I can
    call a method on the collection class to set all items' ParentForm property
    in the collection?

    Does the vb code execute asynchronously here (i.e. the next thing would
    never happen until the deserialization call is finished)? I think this is
    the case unless it is a multithreaded app.

    Any thoughts?

    Thanks,

    Shane

  • Keywords:

    ideserializationcallback, dotnet, visual basic, vb, .net

  • http://dotnet.itags.org/dotnet-visual-basic/182929/«« Last Thread - Next Thread »»