예제 #1
0
        private static ConnectorGraphicsInfos CreateConnectorGraphicsInfos(ConnectionElement connectionElement)
        {
            ConnectorGraphicsInfos infos = new ConnectorGraphicsInfos();

            infos.ConnectorGraphicsInfo = new ConnectorGraphicsInfo[1];
            ConnectorGraphicsInfo info = new ConnectorGraphicsInfo();

            infos.ConnectorGraphicsInfo[0] = info;
            info.Coordinates = new Coordinates[connectionElement.Points.Count];
            for (int i = 0; i < connectionElement.Points.Count; i++)
            {
                var point = connectionElement.Points[i];
                info.Coordinates[i]                      = new Coordinates();
                info.Coordinates[i].XCoordinate          = point.X;
                info.Coordinates[i].YCoordinate          = point.Y;
                info.Coordinates[i].XCoordinateSpecified = true;
                info.Coordinates[i].YCoordinateSpecified = true;
            }
            return(infos);
        }
예제 #2
0
        private List <Point> GetPoints(ConnectorGraphicsInfos transitionConnectorGraphicsInfos)
        {
            List <Point> points = new List <Point>();

            if (transitionConnectorGraphicsInfos?.ConnectorGraphicsInfo != null)
            {
                foreach (ConnectorGraphicsInfo connectorGraphicsInfo in transitionConnectorGraphicsInfos.ConnectorGraphicsInfo)
                {
                    if (connectorGraphicsInfo.Coordinates != null)
                    {
                        foreach (Coordinates coordinate in connectorGraphicsInfo.Coordinates)
                        {
                            if (coordinate.XCoordinateSpecified && coordinate.YCoordinateSpecified)
                            {
                                points.Add(new Point(coordinate.XCoordinate, coordinate.YCoordinate));
                            }
                        }
                    }
                }
            }
            return(points);
        }