private void ExecuteShade(XmlElement element, MagickImage image)
{
Hashtable arguments = new Hashtable();
foreach (XmlAttribute attribute in element.Attributes)
{
if (attribute.Name == "azimuth")
arguments["azimuth"] = Variables.GetValue<double>(attribute);
else if (attribute.Name == "channels")
arguments["channels"] = Variables.GetValue<Channels>(attribute);
else if (attribute.Name == "colorShading")
arguments["colorShading"] = Variables.GetValue<Boolean>(attribute);
else if (attribute.Name == "elevation")
arguments["elevation"] = Variables.GetValue<double>(attribute);
}
if (arguments.Count == 0)
image.Shade();
else if (OnlyContains(arguments, "azimuth", "elevation"))
image.Shade((double)arguments["azimuth"], (double)arguments["elevation"]);
else if (OnlyContains(arguments, "azimuth", "elevation", "colorShading"))
image.Shade((double)arguments["azimuth"], (double)arguments["elevation"], (Boolean)arguments["colorShading"]);
else if (OnlyContains(arguments, "azimuth", "elevation", "colorShading", "channels"))
image.Shade((double)arguments["azimuth"], (double)arguments["elevation"], (Boolean)arguments["colorShading"], (Channels)arguments["channels"]);
else
throw new ArgumentException("Invalid argument combination for 'shade', allowed combinations are: [] [azimuth, elevation] [azimuth, elevation, colorShading] [azimuth, elevation, colorShading, channels]");
}
private void ExecuteShadow(XmlElement element, MagickImage image)