private void ExecuteSparseColor(XmlElement element, MagickImage image)
{
Hashtable arguments = new Hashtable();
foreach (XmlAttribute attribute in element.Attributes)
{
if (attribute.Name == "channels")
arguments["channels"] = Variables.GetValue<Channels>(attribute);
else if (attribute.Name == "method")
arguments["method"] = Variables.GetValue<SparseColorMethod>(attribute);
}
foreach (XmlElement elem in element.SelectNodes("*"))
{
arguments[elem.Name] = CreateSparseColorArgs(elem);
}
if (OnlyContains(arguments, "channels", "method", "args"))
image.SparseColor((Channels)arguments["channels"], (SparseColorMethod)arguments["method"], (IEnumerable<SparseColorArg>)arguments["args"]);
else if (OnlyContains(arguments, "method", "args"))
image.SparseColor((SparseColorMethod)arguments["method"], (IEnumerable<SparseColorArg>)arguments["args"]);
else
throw new ArgumentException("Invalid argument combination for 'sparseColor', allowed combinations are: [channels, method, args] [method, args]");
}
private void ExecuteSplice(XmlElement element, MagickImage image)