コード例 #1
0
ファイル: NodeElement.cs プロジェクト: sheyfzh/envision
 protected void InitConnectors()
 {
     Connects[0] = new ConnectorElement(this);
     Connects[1] = new ConnectorElement(this);
     Connects[2] = new ConnectorElement(this);
     Connects[3] = new ConnectorElement(this);
     UpdateConnectorsPosition();
 }
コード例 #2
0
ファイル: BaseLinkElement.cs プロジェクト: sheyfzh/envision
        internal BaseLinkElement(ConnectorElement conn1, ConnectorElement conn2)
        {
            BorderWidthValue = 1;
            BorderColorValue = Color.Black;

            Connector1Value = conn1;
            Connector2Value = conn2;

            Connector1Value.AddLink(this);
            Connector2Value.AddLink(this);
        }
コード例 #3
0
        public RightAngleLinkElement(ConnectorElement conn1, ConnectorElement conn2) : base(conn1, conn2)
        {
            NeedCalcLinkValue = true;
            InitConnectors(conn1, conn2);
            foreach (var l in LineElements)
            {
                l.StartCap = LineCap.Round;
                l.EndCap   = LineCap.Round;
            }
            StartCapValue = LineCap.Round;
            EndCapValue   = LineCap.Round;

            _label.PositionBySite(LineElements[1]);
        }
コード例 #4
0
ファイル: DiagramBlock.cs プロジェクト: lanicon/waveletstudio
        public void Refresh(Image image, string labelText, object blockState, object[] inputStates, object[] outputStates, PropertyInfo connectionTextProperty)
        {
            _image     = image;
            _labelText = labelText;
            _connectionTextProperty = connectionTextProperty;
            State = blockState;
            SyncContructors();
            _inputStates  = inputStates;
            _outputStates = outputStates;

            if (Connects == null || Connects.Length != inputStates.Length + outputStates.Length)
            {
                Connects = new ConnectorElement[inputStates.Length + outputStates.Length];
                for (var i = 0; i < inputStates.Length; i++)
                {
                    Connects[i] = new ConnectorElement(this)
                    {
                        State = inputStates[i]
                    };
                }
                for (var i = 0; i < outputStates.Length; i++)
                {
                    Connects[inputStates.Length + i] = new ConnectorElement(this)
                    {
                        State = outputStates[i]
                    };
                }
            }
            else
            {
                for (var i = 0; i < inputStates.Length; i++)
                {
                    Connects[i].State = inputStates[i];
                }
                for (var i = 0; i < outputStates.Length; i++)
                {
                    Connects[inputStates.Length + i].State = outputStates[i];
                }
            }
            UpdateConnectorsPosition();
            SyncContructors();
        }
コード例 #5
0
        private void InitConnectors(ConnectorElement conn1, ConnectorElement conn2)
        {
            _conn1Dir = conn1.GetDirection();
            _conn2Dir = conn2.GetDirection();

            if ((_conn1Dir == CardinalDirection.North) || (_conn1Dir == CardinalDirection.South))
            {
                Orientation = Orientation.Vertical;
            }
            else
            {
                Orientation = Orientation.Horizontal;
            }

            if (
                (
                    ((_conn1Dir == CardinalDirection.North) || (_conn1Dir == CardinalDirection.South)) &&
                    ((_conn2Dir == CardinalDirection.East) || (_conn2Dir == CardinalDirection.West)))
                ||
                (
                    ((_conn1Dir == CardinalDirection.East) || (_conn1Dir == CardinalDirection.West)) &&
                    ((_conn2Dir == CardinalDirection.North) || (_conn2Dir == CardinalDirection.South)))
                )
            {
                LineElements    = new LineElement[2];
                LineElements[0] = new LineElement(0, 0, 0, 0);
                LineElements[1] = new LineElement(0, 0, 0, 0);
            }
            else
            {
                LineElements    = new LineElement[3];
                LineElements[0] = new LineElement(0, 0, 0, 0);
                LineElements[1] = new LineElement(0, 0, 0, 0);
                LineElements[2] = new LineElement(0, 0, 0, 0);
            }

            CalcLinkFirtTime();
            CalcLink();
            RestartProps();
        }
コード例 #6
0
 internal StraightLinkElement(ConnectorElement conn1, ConnectorElement conn2) : base(conn1, conn2)
 {
     _label.PositionBySite(Line1);
 }