private void ExecuteExtent(XmlElement element, MagickImage image)
{
Hashtable arguments = new Hashtable();
foreach (XmlAttribute attribute in element.Attributes)
{
if (attribute.Name == "backgroundColor")
arguments["backgroundColor"] = Variables.GetValue<MagickColor>(attribute);
else if (attribute.Name == "geometry")
arguments["geometry"] = Variables.GetValue<MagickGeometry>(attribute);
else if (attribute.Name == "gravity")
arguments["gravity"] = Variables.GetValue<Gravity>(attribute);
else if (attribute.Name == "height")
arguments["height"] = Variables.GetValue<Int32>(attribute);
else if (attribute.Name == "width")
arguments["width"] = Variables.GetValue<Int32>(attribute);
else if (attribute.Name == "x")
arguments["x"] = Variables.GetValue<Int32>(attribute);
else if (attribute.Name == "y")
arguments["y"] = Variables.GetValue<Int32>(attribute);
}
if (OnlyContains(arguments, "geometry"))
image.Extent((MagickGeometry)arguments["geometry"]);
else if (OnlyContains(arguments, "geometry", "backgroundColor"))
image.Extent((MagickGeometry)arguments["geometry"], (MagickColor)arguments["backgroundColor"]);
else if (OnlyContains(arguments, "geometry", "gravity"))
image.Extent((MagickGeometry)arguments["geometry"], (Gravity)arguments["gravity"]);
else if (OnlyContains(arguments, "geometry", "gravity", "backgroundColor"))
image.Extent((MagickGeometry)arguments["geometry"], (Gravity)arguments["gravity"], (MagickColor)arguments["backgroundColor"]);
else if (OnlyContains(arguments, "width", "height"))
image.Extent((Int32)arguments["width"], (Int32)arguments["height"]);
else if (OnlyContains(arguments, "width", "height", "backgroundColor"))
image.Extent((Int32)arguments["width"], (Int32)arguments["height"], (MagickColor)arguments["backgroundColor"]);
else if (OnlyContains(arguments, "width", "height", "gravity"))
image.Extent((Int32)arguments["width"], (Int32)arguments["height"], (Gravity)arguments["gravity"]);
else if (OnlyContains(arguments, "width", "height", "gravity", "backgroundColor"))
image.Extent((Int32)arguments["width"], (Int32)arguments["height"], (Gravity)arguments["gravity"], (MagickColor)arguments["backgroundColor"]);
else if (OnlyContains(arguments, "x", "y", "width", "height"))
image.Extent((Int32)arguments["x"], (Int32)arguments["y"], (Int32)arguments["width"], (Int32)arguments["height"]);
else
throw new ArgumentException("Invalid argument combination for 'extent', allowed combinations are: [geometry] [geometry, backgroundColor] [geometry, gravity] [geometry, gravity, backgroundColor] [width, height] [width, height, backgroundColor] [width, height, gravity] [width, height, gravity, backgroundColor] [x, y, width, height]");
}
private static void ExecuteFlip(MagickImage image)