예제 #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);
 }
예제 #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);
 }