DisableOthers. XmlArrayItem:
[XmlArrayItem("disableother", IsNullable=false)]
[XmlArray("disableOthers")]
public DisableOther[] DisableOthers { get; set; }
:
[XmlRoot("attributes")]
public class Attributes
{
[XmlElement("value")]
public byte Value { get; set; }
[XmlElement("showstatus")]
public string ShowStatus { get; set; }
[XmlArray("disableothers")]
[XmlArrayItem("disableother", IsNullable = false)]
public DisableOther[] DisableOthers { get; set; }
}
[XmlRoot("disableOther")]
public class DisableOther
{
[XmlElement("disablevalue")]
public byte DisableValue { get; set; }
[XmlElement("todisable")]
public string[] ToDisable { get; set; }
}
:
XmlSerializer serializer = new XmlSerializer(typeof(Attributes));
using (var reader = new StringReader(xmlString))
{
var attributes = (Attributes)serializer.Deserialize(reader);
attributes.Dump();
}
:
{
Value: 1,
ShowStatus: "yes",
DisableOthers: [
{
DisableValue: 1,
ToDisable: [ "skew", "skew_side" ]
},
{
DisableValue: 0,
ToDisable: [ "automodel" ]
}
]
}