Show Form


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

Ports
Text Type DataType Accepts IsList CustomAcception
Show IN RUN MULTIPLE FALSE FALSE
AsDialog IN Boolean ONE FALSE FALSE
Instance IN Form ONE FALSE FALSE

Source
namespace Korduene.KGraph.Nodes.UI.Form
{
    [IsNode("Show Form")]
    public class FormShowFormInstance : Node
    {
        Port run = new Port(PortType.IN, typeof(RUN), AcceptsLinks.MULTIPLE, "Show");
        Port asdlg = new Port(PortType.IN, typeof(bool), AcceptsLinks.ONE, "AsDialog");
        Port frminstance = new Port(PortType.IN, typeof(System.Windows.Forms.Form), AcceptsLinks.ONE, "Instance");
        private bool ShowAsDialog
        {
            set { asdlg.Value = value.ToString().ToLower(); }
            get { return GetRuntimeValue(asdlg); }
        }
        public FormShowFormInstance()
        {
            this.Name = "Show Form";
            ShowAsDialog = false;
            AddPort(run);
            AddPort(asdlg);
            AddPort(frminstance);
            run.Instructions = "init";
            Information = "Shows the specified form instance.";
        }
        public override void UpdateResults()
        {
            string code = string.Empty;
            string sh = string.Empty;
            if (ShowAsDialog)
            {
                sh = ".ShowDialog();";
            }
            else
            {
                sh = ".Show();";
            }
            if (frminstance.IsConnected)
            {
                code = GetValue(frminstance) + sh;
            }
            run.Instructions = code;
        }
    }
}