Run Commands


Node Information
Runs list of specified commands using cmd.exe.commands must be valid commands, you can search on the web to find out about commands.
General Information
• This node doesn't have other available options.
Visual
Visual

Ports
Text Type DataType Accepts IsList CustomAcception
Execute IN RUN MULTIPLE FALSE FALSE
Commands IN List<String> ONE TRUE FALSE
Executed OUT RUN MULTIPLE FALSE FALSE

Source
namespace Korduene.KGraph.Nodes.CommandLine
{
    [IsNode("Run Commands")]
    public class RunCommands : Node
    {
        Port run = new Port(PortType.IN, typeof(RUN), AcceptsLinks.MULTIPLE, "Execute");
        Port command = new Port(PortType.IN, typeof(List<string>), AcceptsLinks.ONE, "Commands");
        Port runout = new Port(PortType.OUT, typeof(RUN), AcceptsLinks.MULTIPLE, "Executed");
        public bool HideWindow
        {
            set { Settings[0] = value.ToString(); }
            get { return bool.Parse(Settings[0]); }
        }
        public RunCommands()
        {
            this.Dependency = DependencyLibraries.COMMANDLINE;
            this.NodeType = KGraph.NodeType.Method;
            this.Name = "Run Commands";
            HideWindow = true;
            AddPort(run);
            AddPort(command);
            AddPort(runout);
            Information = "Runs list of specified commands using cmd.exe." +
                "commands must be valid commands, you can search on the web to find out about commands.";
        }
        public override string Code()
        {
            string code = string.Empty;
            code = "CMDExecute cmd = new CMDExecute();\r\n" +
            "cmd.Execute(" + GetValue(command) + ", 0," + HideWindow.ToString().ToLower() + ", true);\r\n" +
            "cmd.CommandExecuted += delegate(object sender, int e)\r\n{\r\n" +
            GetValue(runout) + "};";
            return code;
        }
    }
}