Ejemplo n.º 1
0
        private Limit _GetLimits(XmlNode xmlNode)
        {
            var limit = new Limit {
                Active = xmlNode.Attributes != null && Convert.ToBoolean(xmlNode.Attributes["Active"].Value)
            };

            foreach (XmlNode childNode in xmlNode.ChildNodes)
            {
                switch (childNode.Name)
                {
                case "LoLo":
                    limit.LoLo = _ConvertStringToNullableDouble(childNode.InnerText);
                    break;

                case "Lo":
                    limit.Lo = _ConvertStringToNullableDouble(childNode.InnerText);
                    break;

                case "Target":
                    limit.Target = _ConvertStringToNullableDouble(childNode.InnerText);
                    break;

                case "Hi":
                    limit.Hi = _ConvertStringToNullableDouble(childNode.InnerText);
                    break;

                case "HiHi":
                    limit.HiHi = _ConvertStringToNullableDouble(childNode.InnerText);
                    break;

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

            return(limit);
        }
Ejemplo n.º 2
0
        private Limit _GetLimits(XmlNode xmlNode)
        {
            var limit = new Limit {Active = xmlNode.Attributes != null && Convert.ToBoolean(xmlNode.Attributes["Active"].Value)};

            foreach (XmlNode childNode in xmlNode.ChildNodes)
            {
                switch (childNode.Name)
                {
                    case "LoLo":
                        limit.LoLo = _ConvertStringToNullableDouble(childNode.InnerText);
                        break;

                    case "Lo":
                        limit.Lo = _ConvertStringToNullableDouble(childNode.InnerText);
                        break;

                    case "Target":
                        limit.Target = _ConvertStringToNullableDouble(childNode.InnerText);
                        break;

                    case "Hi":
                        limit.Hi = _ConvertStringToNullableDouble(childNode.InnerText);
                        break;

                    case "HiHi":
                        limit.HiHi = _ConvertStringToNullableDouble(childNode.InnerText);
                        break;

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

            return limit;
        }