Basic serialization question.

  • Thread starter Thread starter BFlaherty_2003
  • Start date Start date
B

BFlaherty_2003

I have a basic serialization app. I am able to serialize my struct
with varying level of success. The problem that I am seeing is that
when any of the values in my class (see below) are not assigned values,
there is no XML generated for this field. For example, if I only
assign a value to NumberOfItems, only the NumberOfItems element will be
serialized. Why is this? For my app, I would like to have empty
elements when there is no value assigned. Any idea as to how I can do
this?

Thanks,
BF

[Serializable]
public struct ConsoleData
{
public int NumberOfItems;
public string NameOfGroup;
public string Test1;
public string Test2;
}
 
Back
Top