ImageMagick.MagickScript.ExecuteCrop C# (CSharp) Method

ExecuteCrop() private method

private ExecuteCrop ( XmlElement element, MagickImage image ) : void
element System.Xml.XmlElement
image MagickImage
return void
    private void ExecuteCrop(XmlElement element, MagickImage image)
    {
      Hashtable arguments = new Hashtable();
      foreach (XmlAttribute attribute in element.Attributes)
      {
        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.Crop((MagickGeometry)arguments["geometry"]);
      else if (OnlyContains(arguments, "width", "height"))
        image.Crop((Int32)arguments["width"], (Int32)arguments["height"]);
      else if (OnlyContains(arguments, "width", "height", "gravity"))
        image.Crop((Int32)arguments["width"], (Int32)arguments["height"], (Gravity)arguments["gravity"]);
      else if (OnlyContains(arguments, "x", "y", "width", "height"))
        image.Crop((Int32)arguments["x"], (Int32)arguments["y"], (Int32)arguments["width"], (Int32)arguments["height"]);
      else
        throw new ArgumentException("Invalid argument combination for 'crop', allowed combinations are: [geometry] [width, height] [width, height, gravity] [x, y, width, height]");
    }
    private void ExecuteCycleColormap(XmlElement element, MagickImage image)
MagickScript