Hide/Show


Node Information
Hides or shows one or multiple form controls.
General Information
• This node doesn't have other available options.
Visual
Visual

Ports
Text Type DataType Accepts IsList CustomAcception
Set IN RUN MULTIPLE FALSE FALSE
Controls IN Object MULTIPLE FALSE FALSE
Hide/Show IN Boolean ONE FALSE FALSE

Source
namespace Korduene.KGraph.Nodes.UI.Control
{
    [IsNode("Hide/Show")]
    public class ControlHideShow : Node
    {
        Port run = new Port(PortType.IN, typeof(RUN), AcceptsLinks.MULTIPLE, "Set");
        Port objectRef = new Port(PortType.IN, typeof(object), AcceptsLinks.MULTIPLE, "Controls");
        Port enable = new Port(PortType.IN, typeof(bool), AcceptsLinks.ONE, "Hide/Show");
        public bool Show
        {
            set { enable.Value = value.ToString(); }
            get { return GetRuntimeValue(enable); }
        }
        public ControlHideShow()
        {
            this.Name = "Hide/Show";
            this.NodeType = NodeType.Method;
            AddPort(run);
            AddPort(objectRef);
            AddPort(enable);
            Information = "Hides or shows one or multiple form controls.";
        }
        public override string Code()
        {
            string code = string.Empty;
            string val = GetValue(enable);
            if (objectRef.ConnectedPorts.Count != 0)
            {
                foreach (var port in objectRef.ConnectedPorts)
                {
                    if (port != null)
                    {
                        code += port.ParentNode.ReferenceName + ".Visible =" + val.ToLower() + ";";
                    }
                }
            }
            return code;
        }
    }
}