JD2022-TU1/main/extern/ImageMagick/JD/ImageMagickTask.cs

70 lines
No EOL
1.4 KiB
C#

using System;
using System.IO;
using System.Reflection;
using TeaBox;
namespace ImageMagick.JD
{
public enum Tool
{
Convert,
}
public class ImageMagickTask : ProcessTask
{
public Tool Tool
{
get;
set;
}
public string Parameters
{
get;
set;
}
public string InputFiles
{
get;
set;
}
public string InputFiles1 // Alias of the above.
{
get { return InputFiles; }
set { InputFiles = value; }
}
public string InputFiles2
{
get;
set;
}
public string OutputFiles
{
get;
set;
}
protected override string GetArguments()
{
return InputFiles1 + " " + InputFiles2 + " " + Parameters + " " + OutputFiles;
}
protected override string CommandName
{
get
{
switch (Tool)
{
case Tool.Convert:
return Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location()), "convert.exe");
default:
throw new Exception("Cannot find the command name!");
}
}
}
}
}