Close Form


Node Information
Closes the specified form.
General Information
• This node doesn't have other available options.
Visual
Visual

Ports
Text Type DataType Accepts IsList CustomAcception
Close IN RUN MULTIPLE FALSE FALSE
Instance IN Form ONE FALSE FALSE

Source
namespace Korduene.KGraph.Nodes.UI.Form
{
    [IsNode("Close Form")]
    public class FormCloseForm : Node
    {
        Port run = new Port(PortType.IN, typeof(RUN), AcceptsLinks.MULTIPLE, "Close");
        Port frminstance = new Port(PortType.IN, typeof(System.Windows.Forms.Form), AcceptsLinks.ONE, "Instance");
        [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 FormCloseForm()
        {
            this.Name = "Close Form";
            AddPort(run);
            AddPort(frminstance);
            Information = "Closes the specified form.";
        }
        public override void UpdateResults()
        {
            string formname = "this";
            if (frminstance.IsConnected)
            {
                formname = GetValue(frminstance);
            }
            else
            {
                formname = FormName;
            }
            run.Instructions = formname + ".Close();";
        }
    }
}