示例#1
0
        public TemplateAction(Process process, string template, TflAction action)
        {
            _process     = process;
            ProcessName  = process.Name;
            Action       = action.Action;
            File         = action.File;
            Method       = action.Method;
            Url          = action.Url;
            TemplateName = template;
            From         = action.From;
            Arguments    = action.Arguments;
            Bcc          = action.Bcc;
            Cc           = action.Cc;
            Html         = action.Html;
            Subject      = action.Subject;
            To           = action.To;
            Body         = action.Body;
            Modes        = action.GetModes();
            Before       = action.Before;
            After        = action.After;
            OldValue     = action.OldValue;
            NewValue     = action.NewValue;
            Command      = action.Command;
            Timeout      = action.TimeOut;

            ActionHandlers = new Dictionary <string, TemplateActionHandler>()
            {
                { "copy", new TemplateActionCopy(_process) },
                { "open", new TemplateActionOpen(_process.Logger) },
                { "run", new TemplateActionRun(_process.Logger) },
                { "web", new TemplateActionWeb(_process.Logger) },
                { "tfl", new TemplateActionTfl(_process.Logger) },
                { "exec", new TemplateActionExecute(_process) },
                { "execute", new TemplateActionExecute(_process) },
                { "mail", new TemplateActionMail(_process.Logger) },
                { "replace", new TemplateActionReplace(_process.Logger) },
                { "dostounix", new TemplateActionReplace("\r\n", "\n") },
                { "unixtodos", new TemplateActionReplace("\n", "\r\n") }
            };
        }
示例#2
0
 public ActionBuilder(IActionHolder builder, TflAction action)
 {
     _builder = builder;
     _action  = action;
 }
 public ActionBuilder Action(string action) {
     var a = new TflAction { Action = action }.WithDefaults();
     _process.Actions.Add(a);
     return new ActionBuilder(this, a);
 }
 public ActionBuilder(IActionHolder builder, TflAction action) {
     _builder = builder;
     _action = action;
 }