How can I serialize structures with read only properties?

  • Thread starter Thread starter Eli
  • Start date Start date
E

Eli

I have a class with which has a member of type
Microsoft.DirectX.Direct3D.AdapterDetails and I'd like to serialize my
class.

Problem is AdapterDetails is not marked as serializable and I can't
make a SerializationSurrogate because all the properties are read
only.

How can I save this data?
 
Hello

Mark the member with NonSerializedAttribute, or implement ISerializable and
serialize the members of the AdapterDetails one by one.

Best regards,
Sherif
 
Back
Top