Hi Codo
Thanks for the reply. I have been experimenting a bit since reading your
comments, and have looked a few things up in the MSDN too.
I tried implementing a constructor like the one you mention, to see if it
gets called, but it didn't.
I use the xml serializer and mark my classes <Serializable()>, rather than
implement ISerializable. Does that make a difference?
Charles
"Codo" <(E-Mail Removed)> wrote in message
news:Fv0Uc.78$(E-Mail Removed)...
> Charles Law wrote:
>
> > When the object is serialised, its state is saved; but not the internal
> > stuff that was derived from objInfo, because it comes from somewhere
else.
> > So far so good.
> I wouldn't say that. You have lost data and you wont be able to recreate
> the object.
>
> >
> > When I deserialise the object, it is effectively created like this
> >
> > MyObj = New MyClass()
> No. It will be created by the constructor
> New(info as serializationInfo, context as StreamingContext)
>
> >
> > so it has to instantiate itself without the objInfo stuff, and therein
> > lies my problem.
> Your problem was in step 1...
>
> >
> > Is there a straight forward way round this, or again is there a pattern
> > that addresses this problem?
> >
> Yes, you have to serialise EVERYTHING. (Or something that will allow you
to
> reconstruct it.)
>
> > TIA
> >
> > Charles
>
|