Delete Directoy


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

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

Source
namespace Korduene.KGraph.Nodes.IO.Directory
{
    [IsNode("Delete Directory")]
    public class DirectoryDelete : Node
    {
        Port run = new Port(PortType.IN, typeof(RUN), AcceptsLinks.MULTIPLE,  "Delete");
        Port path = new Port(PortType.IN, typeof(string), AcceptsLinks.ONE, "Path");
        public string Path
        {
            set { path.Value = value.ToString(); }
            get { return GetRuntimeValue(path); }
        }
        public DirectoryDelete()
        {
            this.Name = "Delete Directoy";
            this.NodeType = KGraph.NodeType.Method;            
            AddPort(run);
            AddPort(path);
            Information = "Deletes 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.Delete(" + spath + ", true);";
            return code;
        }
    }
}