public static AutoCatTags LoadFromXmlElement(XmlElement xElement) { string name = XmlUtil.GetStringFromNode(xElement[XmlName_Name], TypeIdString); AutoCatTags result = new AutoCatTags(name) { Filter = XmlUtil.GetStringFromNode(xElement[XmlName_Filter], null) }; if (XmlUtil.TryGetStringFromNode(xElement[XmlName_Prefix], out string prefix)) { result.Prefix = prefix; } if (XmlUtil.TryGetIntFromNode(xElement[XmlName_MaxTags], out int maxTags)) { result.MaxTags = maxTags; } if (XmlUtil.TryGetBoolFromNode(xElement[XmlName_ListOwnedOnly], out bool listOwnedOnly)) { result.List_OwnedOnly = listOwnedOnly; } if (XmlUtil.TryGetFloatFromNode(xElement[XmlName_ListWeightFactor], out float listWeightFactor)) { result.List_WeightFactor = listWeightFactor; } if (XmlUtil.TryGetIntFromNode(xElement[XmlName_ListMinScore], out int listMinScore)) { result.List_MinScore = listMinScore; } if (XmlUtil.TryGetIntFromNode(xElement[XmlName_ListTagsPerGame], out int listTagsPerGame)) { result.List_TagsPerGame = listTagsPerGame; } if (XmlUtil.TryGetBoolFromNode(xElement[XmlName_ListScoreSort], out bool listScoreSort)) { result.List_ScoreSort = listScoreSort; } if (XmlUtil.TryGetBoolFromNode(xElement[XmlName_ListExcludeGenres], out bool listExcludeGenres)) { result.List_ExcludeGenres = listExcludeGenres; } List <string> tagList = XmlUtil.GetStringsFromNodeList(xElement.SelectNodes(XmlName_TagList + "/" + XmlName_Tag)); result.IncludedTags = tagList == null ? new HashSet <string>() : new HashSet <string>(tagList); return(result); }