コード例 #1
0
        public void ConnectWire(StreamingVisual from, int outNum, StreamingVisual to, int inNum)
        {
            StreamingWire wire = new StreamingWire(from.SimpleShader);

            Childrens.Add(wire);
            List <Vector2> points = new List <Vector2>
            {
                from.OutputPosition(outNum),
                to.InputPosition(inNum)
            };

            wire.Path = points;
            from.ConnectTo(outNum, wire, 0);
            wire.ConnectTo(0, to, inNum);
        }
コード例 #2
0
        public void ConnectWire(StreamingVisual from, int outNum, StreamingVisual to, int inNum, Vector2[] middlePoints)
        {
            StreamingWire wire = new StreamingWire(from.SimpleShader);

            Childrens.Add(wire);

            Vector2 posOut = from.OutputPosition(outNum);
            Vector2 posIn  = to.InputPosition(inNum);

            List <Vector2> points = new List <Vector2>();

            points.Add(posOut);
            points.AddRange(middlePoints);
            points.Add(posIn);
            wire.Path = points;
            from.ConnectTo(outNum, wire, 0);
            wire.ConnectTo(0, to, inNum);
        }