Beispiel #1
0
        private IEnumerable <ControlPointId> GetDiameterShapeAnchorPoints(DiameterShapeBase diameterShape, Rectangle ownerBounds)
        {
            if (diameterShape == null)
            {
                throw new ArgumentNullException("diameterShape");
            }
            // ToDo: Ensure that the ControlPointId values match the expected values
            const int TopCenterControlPoint    = 2;
            const int MiddleLeftControlPoint   = 4;
            const int MiddleRightControlPoint  = 5;
            const int BottomCenterControlPoint = 7;

            // (Re)store top left and bottom right control points and (at last) the position
            yield return(ControlPointId.Reference);

            if (ownerBounds.Width <= ownerBounds.Height)
            {
                yield return(MiddleLeftControlPoint);

                yield return(MiddleRightControlPoint);
            }
            else
            {
                yield return(TopCenterControlPoint);

                yield return(BottomCenterControlPoint);
            }
        }
Beispiel #2
0
 private IEnumerable<ControlPointId> GetDiameterShapeAnchorPoints(DiameterShapeBase diameterShape, Rectangle ownerBounds)
 {
     if (diameterShape == null) throw new ArgumentNullException("diameterShape");
     // ToDo: Ensure that the ControlPointId values match the expected values
     const int TopCenterControlPoint = 2;
     const int MiddleLeftControlPoint = 4;
     const int MiddleRightControlPoint = 5;
     const int BottomCenterControlPoint = 7;
     // (Re)store top left and bottom right control points and (at last) the position
     yield return ControlPointId.Reference;
     if (ownerBounds.Width <= ownerBounds.Height) {
         yield return MiddleLeftControlPoint;
         yield return MiddleRightControlPoint;
     } else {
         yield return TopCenterControlPoint;
         yield return BottomCenterControlPoint;
     }
 }