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); } }
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); } }
public string ExtractType(XAttribute attribute) { XAttribute attr = attribute.GetAttributes()[QualifiedName(KEY_TYPE)]; if (attr == null) { return(null); } return(((XAttributeLiteral)attr).Value); }
public string ExtractDriver(XAttribute attribute) { XAttribute attr = attribute.GetAttributes()[QualifiedName(KEY_DRIVER)]; if (attr == null) { return(null); } return(((XAttributeLiteral)attr).Value); }
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); } }
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); } }