开发者

How do I serialize read-only objects in silverlight?

开发者 https://www.devze.com 2023-03-15 21:45 出处:网络
I\'m having a problem now: for serializing/deserializing an object which has only getters marked as public with DataContractSerializer I have to use [InternalsVisibleTo] attribute and to make setters

I'm having a problem now: for serializing/deserializing an object which has only getters marked as public with DataContractSerializer I have to use [InternalsVisibleTo] attribute and to make setters internal.

How can I avoid this ugly workaround to get my read-only objects successfully serialized/deserialized? Implementing ISerializable/IXmlSerializable开发者_运维百科 is the last thing I want to do. Do I have any other ways to do this?

Thanks in advance.

Alexander


I've ended up with IXmlSerializable.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号