public VisualNodeComponentDisplay(NodeBase parentNode, T childComponent)
        {
            ParentNode     = parentNode;
            ChildComponent = childComponent;
            ChildComponent.GetFlowInput().PropertyChanged  += (o, e) => UpdateInput();
            ChildComponent.GetFlowOutput().PropertyChanged += (o, e) => UpdateOutput();

            UpdateInput();
            UpdateOutput();
        }
예제 #2
0
        protected override bool TryUpdateConnector(IConnector connector, ConnectionType connectionType, out IConnector newConnector)
        {
            if (base.TryUpdateConnector(connector, connectionType, out newConnector))
            {
                return(true);
            }

            ILaminarValue relevantValue = connectionType == ConnectionType.Input ? ChildComponent.GetDisplayValue(INodeField.InputKey) : ChildComponent.GetDisplayValue(INodeField.OutputKey);

            if (relevantValue != null && connector is not ValueConnector)
            {
                newConnector = new ValueConnector(relevantValue, ParentNode, connectionType);
                return(true);
            }

            newConnector = default;
            return(false);
        }