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]");
}
}