Focus


Node Information
Sets input foucs to the specified control.
General Information
• This node doesn't have other available options.
Visual
Visual

Ports
Text Type DataType Accepts IsList CustomAcception
Focus IN RUN MULTIPLE FALSE FALSE
IN Object ONE FALSE FALSE

Source
namespace Korduene.KGraph.Nodes.UI.Control
{
    [IsNode("Focus")]
    public class ControlFocus : Node
    {
        Port run = new Port(PortType.IN, typeof(RUN), AcceptsLinks.MULTIPLE, "Focus");
        Port objectRef = new Port(PortType.IN, typeof(object), AcceptsLinks.ONE);
        public ControlFocus()
        {
            this.Name = "Focus";
            this.NodeType = KGraph.NodeType.Method;
            AddPort(run);
            AddPort(objectRef);
            Information = "Sets input foucs to the specified control.";
        }
        public override string Code()
        {
            string code = string.Empty;
            if (objectRef.IsConnected)
            {
                foreach (var port in objectRef.ConnectedPorts)
                {
                    if (port != null)
                    {
                        code += port.ParentNode.ReferenceName + ".Focus();" + Environment.NewLine;
                    }
                }
            }
            return code;
        }
    }
}