private void ExecutePathQuadraticCurveToRel(XmlElement element, Collection<IPath> paths)
{
Hashtable arguments = new Hashtable();
foreach (XmlAttribute attribute in element.Attributes)
{
if (attribute.Name == "controlPoint")
arguments["controlPoint"] = Variables.GetValue<PointD>(attribute);
else if (attribute.Name == "end")
arguments["end"] = Variables.GetValue<PointD>(attribute);
else if (attribute.Name == "x")
arguments["x"] = Variables.GetValue<double>(attribute);
else if (attribute.Name == "x1")
arguments["x1"] = Variables.GetValue<double>(attribute);
else if (attribute.Name == "y")
arguments["y"] = Variables.GetValue<double>(attribute);
else if (attribute.Name == "y1")
arguments["y1"] = Variables.GetValue<double>(attribute);
}
if (OnlyContains(arguments, "controlPoint", "end"))
paths.Add(new PathQuadraticCurveToRel((PointD)arguments["controlPoint"], (PointD)arguments["end"]));
else if (OnlyContains(arguments, "x1", "y1", "x", "y"))
paths.Add(new PathQuadraticCurveToRel((double)arguments["x1"], (double)arguments["y1"], (double)arguments["x"], (double)arguments["y"]));
else
throw new ArgumentException("Invalid argument combination for 'quadraticCurveToRel', allowed combinations are: [controlPoint, end] [x1, y1, x, y]");
}
private void ExecutePathSmoothCurveToAbs(XmlElement element, Collection<IPath> paths)