예제 #1
0
 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);
     }
 }
예제 #2
0
파일: SvgHelper.cs 프로젝트: p69/SvgForXaml
        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));
        }