Initialize function question...

Initialize function question...

Old forum URL: forums.lhotka.net/forums/t/1196.aspx


albator posted on Tuesday, September 12, 2006

Hi,

I was thinking that Initialize can be used to reinitialize none serializable property or event handler after object deserialization.

But it seems that it is not the case, Initialize in not called after object deserialization in 3 tiers mode.

OnDeserialized should continue to be used for that kind of initialization instead of Initialize; I’m right?

Alain Martineau

 

RockfordLhotka replied on Tuesday, September 12, 2006

That is correct. Initialize() is used to initialize the object, and is purely designed to support some scenarios for partial class code-gen.

OnDeserialized() is designed as a "plumbing" feature to deal with the realities of serialization and the fact that some things (like events) don't carry through automatically.

Copyright (c) Marimer LLC