Example #1
0
    private static SimpleNode CreateBranchNode(System.Guid nodeGuid)
    {
        SimpleNode node = null;

        node = new SimpleNode(nodeGuid, SimpleNodeType.BranchNode);

        Port outputPort = node.InstantiatePort(Orientation.Horizontal, Direction.Output, Port.Capacity.Single, m_objectType);

        outputPort.portName = "true";
        node.outputContainer.Add(outputPort);
        node.RefreshPorts();
        node.RefreshExpandedState();
        node.m_outputPorts.Add(outputPort);

        outputPort          = node.InstantiatePort(Orientation.Horizontal, Direction.Output, Port.Capacity.Single, m_objectType);
        outputPort.portName = "false";
        node.outputContainer.Add(outputPort);
        node.RefreshPorts();
        node.RefreshExpandedState();
        node.m_outputPorts.Add(outputPort);

        Port inputPort = node.InstantiatePort(Orientation.Horizontal, Direction.Input, Port.Capacity.Multi, m_objectType);

        inputPort.portName = "prev";
        node.outputContainer.Add(inputPort);
        node.RefreshPorts();
        node.RefreshExpandedState();
        node.m_inputPorts.Add(inputPort);

        inputPort          = node.InstantiatePort(Orientation.Horizontal, Direction.Input, Port.Capacity.Single, m_boolType);
        inputPort.portName = "if";
        node.outputContainer.Add(inputPort);
        node.RefreshPorts();
        node.RefreshExpandedState();
        node.m_inputPorts.Add(inputPort);

        return(node);
    }
Example #2
0
    private static SimpleNode CreateStartNode(System.Guid nodeGuid)
    {
        SimpleNode node = null;

        node = new SimpleNode(nodeGuid, SimpleNodeType.StartNode);

        Port outPort = node.InstantiatePort(Orientation.Horizontal, Direction.Output, Port.Capacity.Single, m_objectType);

        node.m_outputPorts.Add(outPort);
        node.outputContainer.Add(outPort);
        node.RefreshPorts();
        node.RefreshExpandedState();

        return(node);
    }