I have an XML in the form
0
0
You don't want XmlArrayItem. You want the array of ints to be serialized without a parent element, which means you should decorate the array itself with XmlElement. Because you have a particular order, you will want to use the Order value on the XmlElement attribute. Here's the class, modified accordingly:
public class BackupScheduleSettings
{
public BackupScheduleSettings()
{
ScheduledDay = new int[7];
}
[XmlElement(Order=1)]
public int AggressiveMode;
[XmlElement(Order=2)]
public int ScheduleType;
//[XmlArrayItem("ArrayWrapper")]
[XmlElement(Order=3)]
public int[] ScheduledDay { get; set; }
[XmlElement(Order=4)]
public int WindowStart;
[XmlElement(Order=5)]
public int WindowEnd;
[XmlElement(Order=6)]
public int ScheduleInterval;
}
Here's the generated xML:
0
0
0
0
0
0
0
0
0
0
0
0