TypeOf


Node Information
Specify any type to use as typeof.
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.
Visual
Visual

Ports
Text Type DataType Accepts IsList CustomAcception
Get OUT Object MULTIPLE FALSE FALSE

Source
namespace Korduene.KGraph.Nodes.Types
{
    [IsNode("TypeOf")]
    public class TypeOf : Node
    {
        Port gettype = new Port(PortType.OUT, typeof(object), AcceptsLinks.MULTIPLE, "Get");
        public TypeOf()
        {
            Name = "TypeOf";
            AddPort(gettype);
            OptionsAvilable = true;
            InfoButton.Click += InfoButton_Click;
            Information = "Specify any type to use as typeof.";
        }
        void InfoButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            OpenTypeSelectionMenu(false, false);
        }
        public override void OnTypeSelected(Type type)
        {
            Name = "typeof(" + GraphCore.GetTypeName(type) + ")";
            ReferenceType = type;
            gettype.DataType = type;
            gettype.Instructions = "typeof(" + GraphCore.GetFullTypeName(type) + ")";
        }
    }
}