Form Controls List


Node Information
Gets all the controls within the specified form.
General Information
• This node doesn't have other available options.
Visual
Visual

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

Source
namespace Korduene.KGraph.Nodes.UI.Form
{
    [IsNode("Controls List")]
    public class FormControlsList : Node
    {
        Port frm = new Port(PortType.IN, typeof(System.Windows.Forms.Form), AcceptsLinks.ONE, "Form");
        Port a = new Port(PortType.OUT, typeof(List<object>), AcceptsLinks.MULTIPLE, "Get");
        Port count = new Port(PortType.OUT, typeof(int), AcceptsLinks.MULTIPLE, "Count");
        [System.ComponentModel.Description("if there is no forms connected the value will be set to the current form, which is refered to as 'this'.")]
        public string FormName
        {
            get { return "this"; }
        }
        public FormControlsList()
        {
            this.Name = "Form Controls List";
            count.Value = "0";
            AddPort(frm);
            AddPort(a);
            AddPort(count);
            count.Instructions = "init";
            a.Instructions = "init";
            Information = "Gets all the controls within the specified form.";
        }
        public override void UpdateResults()
        {
            string formname = "this";
            if (frm.IsConnected)
            {
                formname = GetValue(frm);
            }
            else
            {
                formname = FormName;
            }
            count.Instructions = formname + ".Controls.Count";
            a.Instructions = formname + ".Controls";
        }
    }
}

</object>