Create Directoy


Node Information
Creates the specified directory.
General Information
• This node doesn't have other available options.
Visual
Visual

Ports
Text Type DataType Accepts IsList CustomAcception
Create IN RUN MULTIPLE FALSE FALSE
Path IN String ONE FALSE FALSE

Source
namespace Korduene.KGraph.Nodes.IO.Directory
{
    [IsNode("Create Directory")]
    public class DirectoryCreate : Node
    {
        Port run = new Port(PortType.IN, typeof(RUN), AcceptsLinks.MULTIPLE,  "Create");
        Port path = new Port(PortType.IN, typeof(string), AcceptsLinks.ONE, "Path");
        public string Path
        {
            set { path.Value = value.ToString(); }
            get {return GetRuntimeValue(path);}
        }
        public DirectoryCreate()
        {
            this.Name = "Create Directoy";
            this.NodeType = KGraph.NodeType.Method;            
            AddPort(run);
            AddPort(path);
            Information = "Creates the specified directory.";
        }
        public override string Code()
        {
            string spath = string.Empty;
            if (path.IsConnected) { spath = GetValue(path); }
            else { spath = "@" + q + Path + q; }
            string code = "System.IO.Directory.CreateDirectory(" + spath + ");";
            return code;
        }
    }
}