public MagickImage Execute()
{
XmlElement element = (XmlElement)_Script.SelectSingleNode("/msl/*");
if (element.Name == "read")
return CreateMagickImage(element);
else if (element.Name == "collection")
return ExecuteCollection(element);
else
throw new NotSupportedException(element.Name);
}
public static void ReadWriteEvents() { // Load crop script MagickScript script = new MagickScript(SampleFiles.CropMsl); // Event that will be raised when the script wants to read a file script.Read += OnScriptRead; // Event that will be raised when the script wants to write a file script.Write += OnScriptWrite; // Execute the script script.Execute(); }