コード例 #1
0
        public static int PointCount(PathFigure figure)
        {
            int num = 1;

            foreach (PathSegment segment in figure.Segments)
            {
                num += PathSegmentUtilities.GetPointCount(segment);
            }
            if (PathFigureUtilities.IsClosed(figure) && PathFigureUtilities.IsCloseSegmentDegenerate(figure))
            {
                --num;
            }
            return(num);
        }
コード例 #2
0
 public static bool IsOpen(PathFigure figure)
 {
     return(!PathFigureUtilities.IsClosed(figure));
 }
コード例 #3
0
 public static void SetPoint(PathFigure pathFigure, int pointIndex, Point point)
 {
     if (pointIndex == 0 || pointIndex == PathFigureUtilities.PointCount(pathFigure) && PathFigureUtilities.IsClosed(pathFigure) && !PathFigureUtilities.IsCloseSegmentDegenerate(pathFigure))
     {
         pathFigure.StartPoint = point;
     }
     else
     {
         PathSegmentCollection segments = pathFigure.Segments;
         int segmentIndex;
         int segmentPointIndex;
         PathFigureUtilities.GetSegmentFromPointIndex(pathFigure, pointIndex, out segmentIndex, out segmentPointIndex);
         PathSegmentUtilities.SetPoint(segments[segmentIndex], segmentPointIndex, point);
     }
 }