using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Xml.Serialization; namespace NewRockSdk.Tests { [Serializable] [XmlRoot(ElementName = "Control")] public class Model { [XmlAttribute("attribute")] public string Attribute { get; set; } [XmlElement] public string DeviceInfo { get; set; } } [Serializable] [XmlRoot(ElementName = "DeviceInfo")] public class QueryDeviceInfoResponse1 { [XmlElement("manufacturer")] public string Manufacturer { get; set; } [XmlElement("model")] public string Model { get; set; } [XmlElement("version")] public string Version { get; set; } [XmlElement("mac")] public string Mac { get; set; } [XmlArray("devices")] [XmlArrayItem("ext", typeof(Ext), NestingLevel = 0), XmlArrayItem("line", typeof(Line), NestingLevel = 0), XmlArrayItem("group", typeof(Group), NestingLevel = 0), XmlArrayItem("ext", typeof(Ext), NestingLevel = 1)] public List Devices { get; set; } } //[XmlInclude(typeof(Ext)), XmlInclude(typeof(Line)),] public class Device { [XmlAttribute("lineid")] public string LineId { get; set; } [XmlAttribute("id")] public string Id { get; set; } } public class Ext : Device { } public class Line : Device { } public class Group : Device { public Ext Ext { get; set; } } [Serializable] [XmlRoot(ElementName = "DeviceInfo")] public class QueryDeviceInfoResponse2 { [XmlElement("manufacturer")] public string Manufacturer { get; set; } [XmlElement("model")] public string Model { get; set; } [XmlElement("version")] public string Version { get; set; } [XmlElement("mac")] public string Mac { get; set; } [XmlElement("devices")] public Device1 Devices { get; set; } } public class Device1 { [XmlElement("ext")] public Ext1[] Ext1s { get; set; } [XmlElement("line")] public Line1[] Line1s{ get; set; } [XmlElement("group")] public Group1[] Group1s { get; set; } } public class Group1 { [XmlAttribute("id")] public string Id { get; set; } [XmlElement("ext")] public Ext1[] Ext1 { get; set; } } public class Line1 { [XmlAttribute("lineid")] public string LineId { get; set; } [XmlAttribute("id")] public string Id { get; set; } } public class Ext1 { [XmlAttribute("lineid")] public string LineId { get; set; } [XmlAttribute("id")] public string Id { get; set; } } }