public static bool TryParse(string value, out SvgCoordinate result) { if (SvgLength.TryParse(value, out var length)) { result = new SvgCoordinate(length.Value, length.Unit); return(true); } else { result = default(SvgCoordinate); return(false); } }
public static bool TryParseLength(this XmlElement element, string attributeName, out SvgLength result) { result = 0.0F; var attribute = element.GetAttribute(attributeName); if (string.IsNullOrEmpty(attribute)) { return(false); } var lengthText = element.GetAttribute(attributeName); return(SvgLength.TryParse(lengthText, true, out result)); }