protected override void OnAnnotationGraphicChanged(AnnotationGraphic oldAnnotationGraphic, AnnotationGraphic annotationGraphic) { if (oldAnnotationGraphic != null) { var pointsGraphic = oldAnnotationGraphic.Subject as IPointsGraphic; if (pointsGraphic != null) { pointsGraphic.Points.PointAdded -= OnPolygonGraphicClosed; pointsGraphic.Points.PointChanged -= OnPolygonGraphicClosed; pointsGraphic.Points.PointRemoved -= OnPolygonGraphicClosed; pointsGraphic.Points.PointsCleared -= OnPolygonGraphicClosed; } } base.OnAnnotationGraphicChanged(oldAnnotationGraphic, annotationGraphic); if (annotationGraphic != null) { var pointsGraphic = annotationGraphic.Subject as IPointsGraphic; if (pointsGraphic != null) { pointsGraphic.Points.PointAdded += OnPolygonGraphicClosed; pointsGraphic.Points.PointChanged += OnPolygonGraphicClosed; pointsGraphic.Points.PointRemoved += OnPolygonGraphicClosed; pointsGraphic.Points.PointsCleared += OnPolygonGraphicClosed; } } }
/// <summary> /// Sets the <see cref="AnnotationGraphic"/> that owns this strategy. /// </summary> public void SetAnnotationGraphic(AnnotationGraphic annotationGraphic) { if (_annotationGraphic != annotationGraphic) { var oldAnnotationGraphic = _annotationGraphic; _annotationGraphic = annotationGraphic; OnAnnotationGraphicChanged(oldAnnotationGraphic, annotationGraphic); } }
protected override void OnAnnotationGraphicChanged(AnnotationGraphic oldAnnotationGraphic, AnnotationGraphic annotationGraphic) { base.OnAnnotationGraphicChanged(oldAnnotationGraphic, annotationGraphic); if (_firstCalculation) base.Callout.Visible = false; }
/// <summary> /// Called when the <see cref="AnnotationGraphic"/> changes. /// </summary> /// <param name="oldAnnotationGraphic">The former value of <see cref="AnnotationGraphic"/>.</param> /// <param name="annotationGraphic">The new value of <see cref="AnnotationGraphic"/>.</param> protected virtual void OnAnnotationGraphicChanged(AnnotationGraphic oldAnnotationGraphic, AnnotationGraphic annotationGraphic) { }
/// <summary> /// Cloning constructor. /// </summary> protected AnnotationGraphic(AnnotationGraphic source, ICloningContext context) : base(source, context) { context.CloneFields(source, this); }
/// <summary> /// Called when the <see cref="AnnotationGraphic"/> changes. /// </summary> /// <param name="oldAnnotationGraphic">The former value of <see cref="AnnotationGraphic"/>.</param> /// <param name="annotationGraphic">The new value of <see cref="AnnotationGraphic"/>.</param> protected virtual void OnAnnotationGraphicChanged(AnnotationGraphic oldAnnotationGraphic, AnnotationGraphic annotationGraphic) {}