예제 #1
0
 private static void SetSvgPointAttributes(this HtmlElement element, string xAttributeName, string yAttributeName, Point point, SvgValueConverter converter)
 {
     if (point.IsNullOrEmpty())
     {
         element.RemoveAttribute(xAttributeName);
         element.RemoveAttribute(yAttributeName);
     }
     else
     {
         element.SetAttribute(xAttributeName, converter.ToImplicitValueString(point.X));
         element.SetAttribute(yAttributeName, converter.ToImplicitValueString(point.Y));
     }
 }
예제 #2
0
 public static void SetSvgSize(this HtmlElement element, Size size, SvgValueConverter converter)
 {
     if (size.IsNullOrEmpty())
     {
         element.RemoveAttribute("width");
         element.RemoveAttribute("height");
     }
     else
     {
         element.SetAttribute("width", converter.ToImplicitValueString(size.Width));
         element.SetAttribute("height", converter.ToImplicitValueString(size.Height));
     }
 }
예제 #3
0
 private static void SetSvgAttribute(this HtmlElement element, string attributeName, double value, SvgValueConverter converter)
 {
     if (value.IsNaN())
     {
         element.RemoveAttribute(attributeName);
     }
     else
     {
         element.SetAttribute(attributeName, converter.ToImplicitValueString(value));
     }
 }