List


Node Information
Creates a list of a specified type. Click on the info button and specify the type of array you want to create and an empty array will be created.
General Information
• This node has other options, you can view them by clicking on the info button, this also means according to the node you might be able to add more ports than what is already listed.
Visual
Visual

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

Source
namespace Korduene.KGraph.Nodes.List
{
    [IsNode("List")]
    public class VarList : Node
    {
        Port a = new Port(PortType.OUT, typeof(List<object>), AcceptsLinks.MULTIPLE, "Get");
        Port count = new Port(PortType.OUT, typeof(int), AcceptsLinks.MULTIPLE, "Count");
        public VarList()
        {
            this.Name = "List";
            this.NodeType = NodeType.Variable;
            ReturnType = typeof(List<object>);
            count.Value = "0";
            AddPort(a);
            AddPort(count);
            OptionsAvilable = true;
            InfoButton.Click += infoButton_Click;
            count.Instructions = this.ID + ".Count";
            Information = "Creates a list of a specified type. " +
                "Click on the info button and specify the type of array you want to create " +
                "and an empty array will be created.";
        }
        void infoButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            OpenTypeSelectionMenu(false, false);
        }
        public override void OnTypeSelected(Type type)
        {
            ReturnType = type;
            a.DataType = typeof(List<>).MakeGenericType(type);
            ReturnType = typeof(List<>).MakeGenericType(type);
            a.Refresh();
        }
        public override string Code()
        {
            return "new List<" +="" graphcore.getlistsubtype(returntype).fullname="" +="" "="">()";
        }
        public override void UpdateResults()
        {
            count.Instructions = this.ID + ".Count";
            if (!a.IsConnected)
            {
                IsInfoMenuEnabled = true;
            }
            else
            {
                IsInfoMenuEnabled = false;
            }
        }
    }
}

</"></object></object>