Ejemplo n.º 1
0
 public void AssignType(XAttribute attribute, string type)
 {
     if ((type != null) && (type.Trim().Length > 0))
     {
         XAttributeLiteral attr = (XAttributeLiteral)ATTR_TYPE.Clone();
         attr.Value = type;
         attribute.GetAttributes().Add(QualifiedName(KEY_TYPE), attr);
     }
 }
Ejemplo n.º 2
0
 public void AssignDriver(XAttribute attribute, string driver)
 {
     if ((driver != null) && (driver.Trim().Length > 0))
     {
         XAttributeLiteral attr = (XAttributeLiteral)ATTR_DRIVER.Clone();
         attr.Value = driver;
         attribute.GetAttributes().Add(QualifiedName(KEY_DRIVER), attr);
     }
 }
Ejemplo n.º 3
0
        public string ExtractType(XAttribute attribute)
        {
            XAttribute attr = attribute.GetAttributes()[QualifiedName(KEY_TYPE)];

            if (attr == null)
            {
                return(null);
            }
            return(((XAttributeLiteral)attr).Value);
        }
Ejemplo n.º 4
0
        public string ExtractDriver(XAttribute attribute)
        {
            XAttribute attr = attribute.GetAttributes()[QualifiedName(KEY_DRIVER)];

            if (attr == null)
            {
                return(null);
            }
            return(((XAttributeLiteral)attr).Value);
        }
Ejemplo n.º 5
0
        public void AssignAmount(XAttribute attribute, double amount)
        {
            if (amount > 0.0D)
            {
                XAttributeContinuous attr = (XAttributeContinuous)ATTR_AMOUNT.Clone();

                attr.Value = amount;
                attribute.GetAttributes().Add(QualifiedName(KEY_AMOUNT), attr);
            }
        }
Ejemplo n.º 6
0
        void ExtractNestedValuesPrivate(XAttribute element, Dictionary <List <string>, T> nestedValues,
                                        List <string> keys)
        {
            T value = ExtractValue(element);

#pragma warning disable RECS0017 // Posible comparación de tipo de valor con 'null'
            if (value != null)
#pragma warning restore RECS0017 // Posible comparación de tipo de valor con 'null'
            {
                nestedValues.Add(keys, value);
            }
            foreach (XAttribute attr in element.GetAttributes().Values)
            {
                List <string> newKeys = new List <string>(keys);
                newKeys.Add(element.Key);
                ExtractNestedValuesPrivate(attr, nestedValues, newKeys);
            }
        }