When is the class constructor called while deserialising using XmlSerializer.Deserialize?

前端 未结 2 2125
甜味超标
甜味超标 2021-02-13 22:01

My application saves a class away using XmlSerializer, and then later when required, creates an instance by deserialising it again. I would like to use some property members of

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-13 22:28

    The constructor is the creation of your object. Your object need to be created before assign properties value. Then, the constructor will be called first.

    I don't know any documentation for the sequence. But if your class isn't so big, it's possible to add some breakpoint and you'll see which events is first.

提交回复
热议问题