public static IEnumerable <ISODeviceValuePresentation> ReadXML(XmlNodeList nodes) { List <ISODeviceValuePresentation> items = new List <ISODeviceValuePresentation>(); foreach (XmlNode node in nodes) { items.Add(ISODeviceValuePresentation.ReadXML(node)); } return(items); }
public static ISODevice ReadXML(XmlNode node) { ISODevice device = new ISODevice(); device.DeviceId = node.GetXmlNodeValue("@A"); device.DeviceDesignator = node.GetXmlNodeValue("@B"); device.DeviceSoftwareVersion = node.GetXmlNodeValue("@C"); device.ClientNAME = node.GetXmlNodeValue("@D"); device.DeviceSerialNumber = node.GetXmlNodeValue("@E"); device.DeviceStructureLabel = node.GetXmlNodeValue("@F"); device.DeviceLocalizationLabel = node.GetXmlNodeValue("@G"); XmlNodeList detNodes = node.SelectNodes("DET"); if (detNodes != null) { device.DeviceElements.AddRange(ISODeviceElement.ReadXML(detNodes, device)); } XmlNodeList dpdNodes = node.SelectNodes("DPD"); if (dpdNodes != null) { device.DeviceProcessDatas.AddRange(ISODeviceProcessData.ReadXML(dpdNodes)); } XmlNodeList dptNodes = node.SelectNodes("DPT"); if (dptNodes != null) { device.DeviceProperties.AddRange(ISODeviceProperty.ReadXML(dptNodes)); } XmlNodeList dvpNodes = node.SelectNodes("DVP"); if (dvpNodes != null) { device.DeviceValuePresentations.AddRange(ISODeviceValuePresentation.ReadXML(dvpNodes)); } return(device); }