Drives List


Node Information
Gets the list of the available drives on the Computer.
General Information
• This node doesn't have other available options.
Visual
Visual

Ports
Text Type DataType Accepts IsList CustomAcception
Get OUT List<String> MULTIPLE TRUE FALSE
Count OUT Int32 MULTIPLE FALSE FALSE

Source
namespace Korduene.KGraph.Nodes.IO.Drive
{
    [IsNode("Drives List")]
    public class GetDrivesArray : Node
    {                
        Port a = new Port(PortType.OUT, typeof(List<string>), AcceptsLinks.MULTIPLE, "Get");
        Port count = new Port(PortType.OUT, typeof(int), AcceptsLinks.MULTIPLE, "Count");
        public GetDrivesArray()
        {
            NodeType = KGraph.NodeType.Function;
            ReturnType = typeof(List<string>);
            this.Name = "Drives List";
            AddPort(a);
            AddPort(count);
            count.Instructions = "init";
            Information = "Gets the list of the available drives on the Computer.";
        }
        public override string Code()
        {
            count.Instructions = this.ID + "().Count";
            return "return new List<string>(System.IO.Directory.GetLogicalDrives());";
        }
        public override void UpdateResults()
        {
            Code();
        }
    }
}