Represents a C# script that can be compiled and executed.
コード例 #1
0
ファイル: Command.cs プロジェクト: RyanGrange/Ketarin
        /// <summary>
        /// Executes the command.
        /// </summary>
        /// <param name="targetFileName">Content for variable "{url:...}"</param>
        public virtual int Execute(ApplicationJob application, string targetFileName)
        {
            switch (Type)
            {
                case ScriptType.CS:
                    UserCSScript script = new UserCSScript(this.Text);
                    script.Execute(application);
                    break;

                default:
                    return ExecuteBatchCommand(application, this.Text, targetFileName);
            }

            return 0;
        }
コード例 #2
0
ファイル: Command.cs プロジェクト: kimyoungil01/Ketarin
        /// <summary>
        /// Executes the command.
        /// </summary>
        /// <param name="targetFileName">Content for variable "{url:...}"</param>
        public virtual int Execute(ApplicationJob application, string targetFileName)
        {
            switch (Type)
            {
            case ScriptType.CS:
                UserCSScript script = new UserCSScript(this.Text);
                script.Execute(application);
                break;

            default:
                return(ExecuteBatchCommand(application, this.Text, targetFileName));
            }

            return(0);
        }
コード例 #3
0
ファイル: Command.cs プロジェクト: rafaelnikodem/Ketarin
        /// <summary>
        /// Executes the command.
        /// </summary>
        /// <param name="targetFileName">Content for variable "{url:...}"</param>
        public virtual int Execute(ApplicationJob application, string targetFileName = null, ApplicationJobError errorInfo = null)
        {
            switch (Type)
            {
            case ScriptType.CS:
                UserCSScript script = new UserCSScript(this.Text);
                script.Execute(application);
                break;

            case ScriptType.PowerShell:
                PowerShellScript psScript = new PowerShellScript(this.Text);
                psScript.Execute(application, errorInfo);
                return(Conversion.ToInt(psScript.LastOutput));

            default:
                return(ExecuteBatchCommand(application, this.Text, targetFileName));
            }

            return(0);
        }