TextBox Selection Info


Node Information
Gets information about selected text in the specified TextBox.
General Information
• This node doesn't have other available options.
Visual
Visual

Ports
Text Type DataType Accepts IsList CustomAcception
Text OUT String MULTIPLE FALSE FALSE
Start OUT Int32 MULTIPLE FALSE FALSE
Length OUT Int32 MULTIPLE FALSE FALSE
FontFamily OUT String MULTIPLE FALSE FALSE
FontSize OUT Int32 MULTIPLE FALSE FALSE
IsBold OUT Boolean MULTIPLE FALSE FALSE
IsItalic OUT Boolean MULTIPLE FALSE FALSE
IsUnderlined OUT Boolean MULTIPLE FALSE FALSE
ForeColor OUT Color MULTIPLE FALSE FALSE
BackColor OUT Color MULTIPLE FALSE FALSE
TextBox IN TextBox ONE FALSE FALSE

Source
namespace Korduene.KGraph.Nodes.UI.TextBox
{
    [IsNode("Selection Info")]
    public class TextBoxSelectionInfo : Node
    {
        Port text = new Port(PortType.OUT, typeof(string), AcceptsLinks.MULTIPLE, "Text");
        Port selstart = new Port(PortType.OUT, typeof(int), AcceptsLinks.MULTIPLE, "Start");
        Port sellength = new Port(PortType.OUT, typeof(int), AcceptsLinks.MULTIPLE, "Length");
        Port fontfamily = new Port(PortType.OUT, typeof(string), AcceptsLinks.MULTIPLE, "FontFamily");
        Port fontsize = new Port(PortType.OUT, typeof(int), AcceptsLinks.MULTIPLE, "FontSize");
        Port isbold = new Port(PortType.OUT, typeof(bool), AcceptsLinks.MULTIPLE, "IsBold");
        Port isitalic = new Port(PortType.OUT, typeof(bool), AcceptsLinks.MULTIPLE, "IsItalic");
        Port isunderlined = new Port(PortType.OUT, typeof(bool), AcceptsLinks.MULTIPLE, "IsUnderlined");
        Port forecolor = new Port(PortType.OUT, typeof(System.Drawing.Color), AcceptsLinks.MULTIPLE, "ForeColor");
        Port backcolor = new Port(PortType.OUT, typeof(System.Drawing.Color), AcceptsLinks.MULTIPLE, "BackColor");
        Port objectRef = new Port(PortType.IN, typeof(Korduene.Designer.Standard.TextBox), AcceptsLinks.ONE, "TextBox");
        public TextBoxSelectionInfo()
        {
            this.Name = "TextBox Selection Info";
            selstart.Value = "0";
            sellength.Value = "0";
            AddPort(text);
            AddPort(selstart);
            AddPort(sellength);
            AddPort(fontfamily);
            AddPort(fontsize);
            AddPort(isbold);
            AddPort(isitalic);
            AddPort(isunderlined);
            AddPort(forecolor);
            AddPort(backcolor);
            AddPort(objectRef);
            Information = "Gets information about selected text in the specified TextBox.";
        }
        public override void UpdateResults()
        {
            if (objectRef.ConnectedPorts.Count != 0)
            {
                string o = GetValue(objectRef);
                selstart.Instructions = o + ".SelectionStart";
                sellength.Instructions = o + ".SelectionLength";
                fontfamily.Instructions = o + ".SelectionFont.FontFamily";
                fontsize.Instructions = o + ".SelectionFont.Size";
                text.Instructions = o + ".Text";
                isitalic.Instructions = o + ".SelectionFont.Italic";
                isbold.Instructions = o + ".SelectionFont.Bold";
                isunderlined.Instructions = o + ".SelectionFont.Underline";
                forecolor.Instructions = o + ".SelectionColor";
                backcolor.Instructions = o + ".SelectionBackColor";
            }
        }
    }
}