diff --git a/ICD.Common.Utils/Xml/XmlUtils.cs b/ICD.Common.Utils/Xml/XmlUtils.cs index fa28888..6caecd0 100644 --- a/ICD.Common.Utils/Xml/XmlUtils.cs +++ b/ICD.Common.Utils/Xml/XmlUtils.cs @@ -145,6 +145,21 @@ namespace ICD.Common.Utils.Xml } } + /// + /// Gets the value of the attribute with the given name and returns as a bool. + /// + /// + /// + /// + /// + [PublicAPI] + public static T GetAttributeAsEnum(string xml, string name, bool ignoreCase) + where T : struct, IConvertible + { + string attribute = GetAttributeAsString(xml, name); + return EnumUtils.Parse(attribute, ignoreCase); + } + #endregion #region Recurse