Form Clear Controls


Node Information
Clear controls from the specified Form.
General Information
• This node doesn't have other available options.
Visual
Visual

Ports
Text Type DataType Accepts IsList CustomAcception
Add IN RUN MULTIPLE FALSE FALSE
Form IN Form MULTIPLE FALSE FALSE

Source
namespace Korduene.KGraph.Nodes.UI.Form
{
    [IsNode("Clear Controls")]
    public class FormControlClear : Node
    {
        Port run = new Port(PortType.IN, typeof(RUN), AcceptsLinks.MULTIPLE, "Add");
        Port objectRefOut = new Port(PortType.IN, typeof(System.Windows.Forms.Form), AcceptsLinks.MULTIPLE, "Form");
        [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 FormControlClear()
        {
            this.Name = "Form Clear Controls";
            this.NodeType = KGraph.NodeType.Method;
            AddPort(run);
            AddPort(objectRefOut);
            Information = "Clear controls from the specified Form.";
        }
        public override string Code()
        {
            string code = string.Empty;
            string formname = "this";
            if (objectRefOut.IsConnected)
            {
                formname = GetValue(objectRefOut);
            }
            else
            {
                formname = FormName;
            }
            code = formname + ".Controls.Clear();";
            return code;
        }
    }
}