Exemplo n.º 1
0
        private Parameters.BaseParameter ReadParameterConfiguration(string configurationFile, XmlNode node)
        {
            Parameters.BaseParameter parameter = null;

            XmlElement xmlConfig = (XmlElement)node;

            for (int c = 0; c < node.Attributes.Count; c++)
            {
                if (string.Compare(node.Attributes[c].Name, "type", true) == 0)
                {
                    string value = node.Attributes[c].Value;

                    if (string.Compare(value, Parameters.ParameterDivisor.AttributeType, true) == 0)
                    {
                        return(ReadParameterDivisorConfiguration(configurationFile, node));
                    }
                    else if (string.Compare(value, Parameters.ParameterPosition.AttributeType, true) == 0)
                    {
                        return(ReadParameterPositionConfiguration(configurationFile, node));
                    }
                }
            }

            return(parameter);
        }
Exemplo n.º 2
0
        private void ReadBaseParameters(string configurationFile, XmlNode node, Parameters.BaseParameter parameter)
        {
            XmlElement element = (XmlElement)node;

            XmlNodeList xmlName = element.GetElementsByTagName(Parameters.BaseParameter.KeyName);

            if (xmlName != null && xmlName.Count > 0)
            {
                parameter.Name = xmlName[0].InnerText;
            }
            XmlNodeList xmlValue = element.GetElementsByTagName(Parameters.BaseParameter.KeyValue);

            if (xmlValue != null && xmlValue.Count > 0)
            {
                parameter.Value = xmlValue[0].InnerText;
            }
            XmlNodeList xmlType = element.GetElementsByTagName(Parameters.BaseParameter.KeyType);

            if (xmlType != null && xmlType.Count > 0)
            {
                parameter.Type = xmlType[0].InnerText;
            }
            XmlNodeList xmlOrder = element.GetElementsByTagName(Parameters.BaseParameter.KeyOrder);

            if (xmlOrder != null && xmlOrder.Count > 0)
            {
                parameter.Order = int.Parse(xmlOrder[0].InnerText);
            }



            XmlNodeList xmlExpected = element.GetElementsByTagName(Parameters.ExpectedValue.KeyExpectedValue);

            if (xmlExpected != null && xmlExpected.Count > 0)
            {
                parameter.ExpectedValue = ReadExpectedValue(configurationFile, xmlExpected[0]);
            }
        }