Create Zip


Node Information
Compresses the specified directory into a Zip file.
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
Source IN String ONE FALSE FALSE
Destination IN String ONE FALSE FALSE
Include Base IN Boolean ONE FALSE FALSE

Source
namespace Korduene.KGraph.Nodes.IO.Zip
{
    [IsNode("Create Zip")]
    public class ZipCreate : Node
    {
        Port run = new Port(PortType.IN, typeof(RUN), AcceptsLinks.MULTIPLE, "Create");
        Port sourcepath = new Port(PortType.IN, typeof(string), AcceptsLinks.ONE, "Source");
        Port destpath = new Port(PortType.IN, typeof(string), AcceptsLinks.ONE, "Destination");
        Port inclbase = new Port(PortType.IN, typeof(bool), AcceptsLinks.ONE, "Include Base");
        public string Source
        {
            set { sourcepath.Value = value.ToString(); }
            get { return GetRuntimeValue(sourcepath); }
        }
        public string Destination
        {
            set { destpath.Value = value.ToString(); }
            get { return GetRuntimeValue(destpath); }
        }
        public bool IncludeBaseDirectory
        {
            set { inclbase.Value = value.ToString(); }
            get { return GetRuntimeValue(inclbase); }
        }
        public System.IO.Compression.CompressionLevel CompressionLevel { set { Settings[0] = value.ToString(); } get { if (string.IsNullOrEmpty(Settings[0])) { return System.IO.Compression.CompressionLevel.NoCompression; } else { return (System.IO.Compression.CompressionLevel)Enum.Parse(typeof(System.IO.Compression.CompressionLevel), Settings[0]); } } }
        public ZipCreate()
        {
            this.Name = "Create Zip";
            this.NodeType = KGraph.NodeType.Method;
            AddPort(run);
            AddPort(sourcepath);
            AddPort(destpath);
            AddPort(inclbase);
            Information = "Compresses the specified directory into a Zip file.";
        }
        public override string Code()
        {
            return "System.IO.Compression.ZipFile.CreateFromDirectory(" + GetValue(sourcepath) + "," + GetValue(destpath) + ", System.IO.Compression.CompressionLevel." + CompressionLevel.ToString() + "," + GetValue(inclbase) + ");";
        }
    }
}