Exemplo n.º 1
0
        private Calibration _GetCalibration(XmlNode xmlNode)
        {
            if (xmlNode.Attributes != null)
            {
                var calibration = new Calibration {
                    Id = new Guid(xmlNode.Attributes["Id"].Value)
                };

                foreach (XmlNode childNode in xmlNode.ChildNodes)
                {
                    switch (childNode.Name)
                    {
                    case "Timestamp":
                        calibration.Timestamp = _GetTimeStamp(childNode);
                        break;

                    case "Product":
                        calibration.Product = _GetProduct(childNode);
                        break;

                    case "UserName":
                        calibration.Username = childNode.InnerText;
                        break;

                    case "Channels":
                        calibration.Channels = _GetChannelList(childNode);
                        break;

                    default:
                        Logger.WriteDebugMessage(string.Format("Unknown XML Node found! Node Name: '{0}'", childNode.Name));
                        break;
                    }
                }

                return(calibration);
            }

            return(null);
        }
Exemplo n.º 2
0
        private Calibration _GetCalibration(XmlNode xmlNode)
        {
            if (xmlNode.Attributes != null)
            {
                var calibration = new Calibration {Id = new Guid(xmlNode.Attributes["Id"].Value)};

                foreach (XmlNode childNode in xmlNode.ChildNodes)
                {
                    switch (childNode.Name)
                    {
                        case "Timestamp":
                            calibration.Timestamp = _GetTimeStamp(childNode);
                            break;

                        case "Product":
                            calibration.Product = _GetProduct(childNode);
                            break;

                        case "UserName":
                            calibration.Username = childNode.InnerText;
                            break;

                        case "Channels":
                            calibration.Channels = _GetChannelList(childNode);
                            break;

                        default:
                            Logger.WriteDebugMessage(string.Format("Unknown XML Node found! Node Name: '{0}'", childNode.Name));
                            break;
                    }
                }

                return calibration;
            }

            return null;
        }