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); }
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); }