static private AilmentInfo AilmentXmlNodeToInfo(XmlNode node) { if (node?.Attributes == null) { throw new ArgumentNullException(nameof(node), "XmlNode and its attributes cannot be null!"); } AilmentInfo ailment = new AilmentInfo { Id = node.Attributes["Name"]?.Value, CanSkip = bool.Parse(node.Attributes["Skip"]?.Value ?? "true") }; return(ailment); }
static private AilmentInfo AilmentXmlNodeToInfo(XmlNode node) { if (node?.Attributes == null) { throw new ArgumentNullException(nameof(node), "XmlNode and its attributes cannot be null!"); } AilmentInfo ailment = new AilmentInfo { Name = node.Attributes["Name"]?.Value, Id = Convert.ToUInt32(node.Attributes["Id"]?.Value ?? "1000"), CanSkip = Convert.ToBoolean(node.Attributes["Skip"]?.Value ?? "true"), Group = node.Attributes["Group"]?.Value ?? "UNKNOWN", Type = (AilmentType)Convert.ToInt32(node.Attributes["Type"]?.Value ?? "0") }; return(ailment); }