public VisualNodeComponentDisplay(NodeBase parentNode, T childComponent) { ParentNode = parentNode; ChildComponent = childComponent; ChildComponent.GetFlowInput().PropertyChanged += (o, e) => UpdateInput(); ChildComponent.GetFlowOutput().PropertyChanged += (o, e) => UpdateOutput(); UpdateInput(); UpdateOutput(); }
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); }