Get Properties


Node Information
Gets properties of the specifed object. Click on the info button for available properties.
General Information
• This node has other options, you can view them by clicking on the info button, this also means according to the node you might be able to add more ports than what is already listed.
• Some of the ports of this node can change their types and accept types automatically.
Visual
Visual

Ports
Text Type DataType Accepts IsList CustomAcception
Get IN Object ONE FALSE TRUE

Source
namespace Korduene.KGraph.Nodes.IO.SerialPort
{
    [IsNode("Get Properties")]
    public class GetProperties : Node
    {
        Port serial = new Port(PortType.IN, typeof(System.IO.Ports.SerialPort), AcceptsLinks.ONE, "SerialPort");
        public GetProperties()
        {
            Name = "Get Properties";
            AddPort(serial);
            OptionsAvilable = true;
            Information = "Gets properties of the specified Serial Port.";
            InfoContextMenu = GetTypePropertiesMenu(typeof(System.IO.Ports.SerialPort), false);
        }
        public override void OnTypePropertySelected(System.Reflection.PropertyInfo opi)
        {
            Port port = new Port(PortType.OUT, opi.PropertyType, AcceptsLinks.MULTIPLE, opi.Name, true);
            port.IsRemovable = true;
            AddPort(port);
        }
        public override void UpdateResults()
        {
            if (!serial.IsConnected)
            {
                ErrorMessage = "No Serial Port is connected.";
                Status = NodeStatus.ERROR;
                return;
            }
            else
            {
                Status = NodeStatus.OK;
            }
            string serialvalue = GetValue(serial);
            foreach (var port in Ports)
            {
                if (port.IsExtra)
                {
                    port.Instructions = serialvalue + "." + port.Text;
                }
            }
        }
    }
}