ImageMagick.MagickScript.ExecuteUnsharpMask C# (CSharp) Method

ExecuteUnsharpMask() private method

private ExecuteUnsharpMask ( XmlElement element, MagickImage image ) : void
element XmlElement
image MagickImage
return void
    private void ExecuteUnsharpMask(XmlElement element, MagickImage image)
    {
      Hashtable arguments = new Hashtable();
      foreach (XmlAttribute attribute in element.Attributes)
      {
        if (attribute.Name == "amount")
          arguments["amount"] = Variables.GetValue<double>(attribute);
        else if (attribute.Name == "channels")
          arguments["channels"] = Variables.GetValue<Channels>(attribute);
        else if (attribute.Name == "radius")
          arguments["radius"] = Variables.GetValue<double>(attribute);
        else if (attribute.Name == "sigma")
          arguments["sigma"] = Variables.GetValue<double>(attribute);
        else if (attribute.Name == "threshold")
          arguments["threshold"] = Variables.GetValue<double>(attribute);
      }
      if (OnlyContains(arguments, "radius", "sigma"))
        image.UnsharpMask((double)arguments["radius"], (double)arguments["sigma"]);
      else if (OnlyContains(arguments, "radius", "sigma", "amount", "threshold"))
        image.UnsharpMask((double)arguments["radius"], (double)arguments["sigma"], (double)arguments["amount"], (double)arguments["threshold"]);
      else if (OnlyContains(arguments, "radius", "sigma", "amount", "threshold", "channels"))
        image.UnsharpMask((double)arguments["radius"], (double)arguments["sigma"], (double)arguments["amount"], (double)arguments["threshold"], (Channels)arguments["channels"]);
      else if (OnlyContains(arguments, "radius", "sigma", "channels"))
        image.UnsharpMask((double)arguments["radius"], (double)arguments["sigma"], (Channels)arguments["channels"]);
      else
        throw new ArgumentException("Invalid argument combination for 'unsharpMask', allowed combinations are: [radius, sigma] [radius, sigma, amount, threshold] [radius, sigma, amount, threshold, channels] [radius, sigma, channels]");
    }
    private void ExecuteVignette(XmlElement element, MagickImage image)
MagickScript