public SvgPatternElement(SvgDocument document, SvgBaseElement parent, XElement patternElement)
: base(document, parent, patternElement)
{
XAttribute pattern_transform_attribute = patternElement.Attribute("patternTransform");
if(pattern_transform_attribute != null)
PatternTransform = SvgTransform.Parse(pattern_transform_attribute.Value);
XAttribute pattern_units_attribute = patternElement.Attribute("patternUnits");
if(pattern_units_attribute != null)
switch(pattern_units_attribute.Value)
{
case "objectBoundingBox":
PatternUnits = SvgPatternUnits.ObjectBoundingBox;
break;
case "userSpaceOnUse":
PatternUnits = SvgPatternUnits.UserSpaceOnUse;
break;
default:
throw new NotImplementedException(String.Format("patternUnits value '{0}' is no supported", pattern_units_attribute.Value));
}
XAttribute width_attribute = patternElement.Attribute("width");
if(width_attribute != null)
Width = SvgLength.Parse(width_attribute.Value);
XAttribute height_attribute = patternElement.Attribute("height");
if(height_attribute != null)
Height = SvgLength.Parse(height_attribute.Value);
}