123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- 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<Device> 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; }
- }
- }
|