RemoveDefine() public method

Removes the define with the specified name.
public RemoveDefine ( MagickFormat format, string name ) : void
format MagickFormat The format to set the define for.
name string The name of the define.
return void
Example #1
0
        private void ExecuteRemoveDefine(XmlElement element, MagickSettings settings)
        {
            Hashtable arguments = new Hashtable();

            foreach (XmlAttribute attribute in element.Attributes)
            {
                if (attribute.Name == "format")
                {
                    arguments["format"] = Variables.GetValue <MagickFormat>(attribute);
                }
                else if (attribute.Name == "name")
                {
                    arguments["name"] = Variables.GetValue <String>(attribute);
                }
            }
            if (OnlyContains(arguments, "format", "name"))
            {
                settings.RemoveDefine((MagickFormat)arguments["format"], (String)arguments["name"]);
            }
            else if (OnlyContains(arguments, "name"))
            {
                settings.RemoveDefine((String)arguments["name"]);
            }
            else
            {
                throw new ArgumentException("Invalid argument combination for 'removeDefine', allowed combinations are: [format, name] [name]");
            }
        }
Example #2
0
 private void ExecuteRemoveDefine(XmlElement element, MagickSettings settings)
 {
   Hashtable arguments = new Hashtable();
   foreach (XmlAttribute attribute in element.Attributes)
   {
     if (attribute.Name == "format")
       arguments["format"] = Variables.GetValue<MagickFormat>(attribute);
     else if (attribute.Name == "name")
       arguments["name"] = Variables.GetValue<String>(attribute);
   }
   if (OnlyContains(arguments, "format", "name"))
     settings.RemoveDefine((MagickFormat)arguments["format"], (String)arguments["name"]);
   else if (OnlyContains(arguments, "name"))
     settings.RemoveDefine((String)arguments["name"]);
   else
     throw new ArgumentException("Invalid argument combination for 'removeDefine', allowed combinations are: [format, name] [name]");
 }