Invert (Enable/Disable)


Node Information
Inverts Enabled state of one or multiple form controls.
General Information
• This node doesn't have other available options.
Visual
Visual

Ports
Text Type DataType Accepts IsList CustomAcception
Invert IN RUN MULTIPLE FALSE FALSE
Controls IN Object MULTIPLE FALSE FALSE

Source
namespace Korduene.KGraph.Nodes.UI.Control
{
    [IsNode("Invert (Enable/Disable)")]
    public class ControlInvertEnableDisable : Node
    {
        Port run = new Port(PortType.IN, typeof(RUN), AcceptsLinks.MULTIPLE, "Invert");
        Port objectRef = new Port(PortType.IN, typeof(object), AcceptsLinks.MULTIPLE, "Controls");
        public ControlInvertEnableDisable()
        {
            this.Name = "Invert (Enable/Disable)";
            this.NodeType = KGraph.NodeType.Method;
            AddPort(run);
            AddPort(objectRef);
            Information = "Inverts Enabled state of one or multiple form controls.";
        }
        public override string Code()
        {
            string code = string.Empty;
            if (objectRef.ConnectedPorts.Count != 0)
            {
                foreach (var port in objectRef.ConnectedPorts)
                {
                    if (port != null)
                    {
                        code += port.ParentNode.ReferenceName + ".Enabled ^=true;";
                    }
                }
            }
            return code;
        }
    }
}