Beispiel #1
0
        public void BindPort(PortDescription port)
        {
            if (port.Owner != this)
            {
                return;
            }

            var portVisuals = VisualPort.Create(port, EdgeConnectorListener);

            port.SetVisualPort(portVisuals);

            switch (port.PortDirection)
            {
            case PortDirection.Input:
                inputContainer.Add(portVisuals);
                break;

            case PortDirection.Output:
                outputContainer.Add(portVisuals);
                break;
            }
        }
Beispiel #2
0
        public void BindPortsAndProperties()
        {
            foreach (var slot in m_portDescriptions)
            {
                var portVisuals = VisualPort.Create(slot, EdgeConnectorListener);
                slot.SetVisualPort(portVisuals);

                switch (slot.PortDirection)
                {
                case PortDirection.Input:
                    inputContainer.Add(portVisuals);
                    break;

                case PortDirection.Output:
                    outputContainer.Add(portVisuals);
                    break;
                }
            }


            foreach (var visualProperty in m_visualProperties)
            {
                if (bottomContainer.ClassListContains("compact-ui"))
                {
                    visualProperty.LoadStyleSheet("Styles/Properties/CompactProperty");
                }
                else
                {
                    visualProperty.LoadStyleSheet("Styles/Properties/VisualProperty");
                }
                visualProperty.Initialize();

                bottomContainer.Add(visualProperty);
            }

            RefreshExpandedState();
            RefreshPorts();
        }