Ejemplo n.º 1
0
 public static bool TryGetValueAsInt32(this XmlAttributeCollection xmlAttributeCollection, string attrName, out int attrVal, Properties properties = null)
 {
     if (xmlAttributeCollection.TryGetValueAsString(attrName, out string attrValStr))
     {
         Int32.TryParse(attrValStr, out attrVal);
         return(true);
     }
     attrVal = default;
     return(false);
 }
Ejemplo n.º 2
0
 public static bool TryGetValueAsBoolean(this XmlAttributeCollection xmlAttributeCollection, string attrName, out bool attrVal, Properties properties = null)
 {
     if (xmlAttributeCollection.TryGetValueAsString(attrName, out string attrValStr))
     {
         if (properties != null)
         {
             attrValStr = properties.GetPropertyValue(attrValStr);
         }
         Boolean.TryParse(attrValStr, out attrVal);
         return(true);
     }
     attrVal = default;
     return(false);
 }