Ejemplo n.º 1
0
        /// <override></override>
        public override ControlPointId AddConnectionPoint(int x, int y)
        {
            if (!ContainsPoint(x, y)) throw new NShapeException("Coordinates {0},{1} are not part of this shape.", x, y);

            ControlPointId pointId = GetNewControlPointId();
            RelativePosition relPos = CalculateRelativePosition(x, y);
            relPos.B = 0;
            LineControlPoint ctrlPoint = new DynamicConnectionPoint(this, pointId, relPos);

            // Insert ConnectionPoint
            InsertControlPoint(ControlPointCount - 1, ctrlPoint);

            return pointId;
        }
Ejemplo n.º 2
0
        /// <summary>Overriden method. Check base class for documentation.</summary>
        public override ControlPointId AddConnectionPoint(int x, int y)
        {
            if (!ContainsPoint(x, y)) throw new NShapeException("Coordinates {0},{1} are not on the shape.", x, y);

            ControlPointId pointId = GetNewControlPointId();
            RelativePosition relPos = CalculateRelativePosition(x, y);
            LineControlPoint ctrlPoint = new DynamicConnectionPoint(this, pointId, relPos);

            // Find insert position
            ControlPointId insertId = FindInsertionPointId(x, y, false);
            int idx = GetControlPointIndex(insertId);

            Debug.Assert(idx < ControlPointCount);
            InsertControlPoint(idx + 1, ctrlPoint);

            return pointId;
        }