/// <summary> /// Called when the respective <see cref="MapShapeLayer" /> is invalidated and its contents are cleared. /// </summary> /// <param name="layer">The shape layer.</param> protected internal override void OnShapeLayerCleared(MapShapeLayer layer) { if (layer == null) { return; } base.OnShapeLayerCleared(layer); var context = new SelectionChangeContext() { Layer = layer }; for (int i = this.selectedModels.Count - 1; i >= 0; i--) { var shape = this.map == null ? null : this.map.FindShapeForModel(this.selectedModels[i]); if (shape == null || shape.LayerId != layer.Id) { continue; } context.Shape = shape; context.Model = this.selectedModels[i]; this.DeselectShape(context); } this.NotifySelectionChanged(context); }
/// <summary> /// Initiates a hit test on the specified <see cref="Point"/> location. /// </summary> /// <param name="location">The location.</param> /// <param name="shapeLayer">The <see cref="MapShapeLayer"/> instance whose shapes to hit test. /// Default value is null i.e. hit testing is performed on all layers (starting from the top-most one) and the first positive match is returned.</param> /// <returns></returns> public IMapShape HitTest(Point location, MapShapeLayer shapeLayer = null) { int layerZIndex = -1; if (shapeLayer != null) { layerZIndex = shapeLayer.ZIndex; } var result = this.D2DSurface.HitTest(location, layerZIndex); if (result != null) { return(result.Model as IMapShape); } return(null); }
/// <summary> /// Called when the respective <see cref="MapShapeLayer" /> is invalidated and its contents are cleared. /// </summary> /// <param name="layer">The shape layer.</param> protected internal override void OnShapeLayerCleared(MapShapeLayer layer) { base.OnShapeLayerCleared(layer); this.HideToolTip(); }
/// <summary> /// Called when the respective <see cref="MapShapeLayer"/> is invalidated and its contents are cleared. /// </summary> /// <param name="layer">The shape layer.</param> protected internal virtual void OnShapeLayerCleared(MapShapeLayer layer) { }
/// <summary> /// Performs the core logic behind the <see cref="Process"/> routine. /// </summary> /// <param name="context"></param> /// <param name="container"></param> protected virtual void ProcessCore(MapShapeLabelLayoutContext context, MapShapeLayer container) { }
/// <summary> /// Applies the custom layout logic given the provided layout context and layer. /// </summary> /// <param name="context"></param> /// <param name="container"></param> public void Process(MapShapeLabelLayoutContext context, MapShapeLayer container) { this.ProcessCore(context, container); }