private void OnGraphicSelectionChanged(object sender, GraphicSelectionChangedEventArgs e) { if (e.SelectedGraphic != null) { IPresentationImage image = e.SelectedGraphic.ParentPresentationImage; IOverlayGraphicsProvider overlayGraphicsProvider = image as IOverlayGraphicsProvider; if (overlayGraphicsProvider != null) { ShowAnglesToolCompositeGraphic compositeGraphic = (ShowAnglesToolCompositeGraphic)CollectionUtils.SelectFirst(overlayGraphicsProvider.OverlayGraphics, g => g is ShowAnglesToolCompositeGraphic); if (compositeGraphic == null) { overlayGraphicsProvider.OverlayGraphics.Add(compositeGraphic = new ShowAnglesToolCompositeGraphic(this)); } compositeGraphic.Select(e.SelectedGraphic); } } }
private void OnGraphicSelectionChanged(object sender, GraphicSelectionChangedEventArgs e) { if (e.SelectedGraphic != null) { IPresentationImage image = e.SelectedGraphic.ParentPresentationImage; IOverlayGraphicsProvider overlayGraphicsProvider = image as IOverlayGraphicsProvider; if (overlayGraphicsProvider != null) { ShowAnglesToolCompositeGraphic compositeGraphic = (ShowAnglesToolCompositeGraphic) CollectionUtils.SelectFirst(overlayGraphicsProvider.OverlayGraphics, g => g is ShowAnglesToolCompositeGraphic); if (compositeGraphic == null) { overlayGraphicsProvider.OverlayGraphics.Add(compositeGraphic = new ShowAnglesToolCompositeGraphic(this)); } compositeGraphic.Select(e.SelectedGraphic); } } }
/// <summary> /// Cloning constructor. /// </summary> /// <param name="source">The source object from which to clone.</param> /// <param name="context">The cloning context object.</param> protected ShowAnglesToolCompositeGraphic(ShowAnglesToolCompositeGraphic source, ICloningContext context) : base() { context.CloneFields(source, this); _sourceGraphicVisible = source.Visible; }