// makes requested Graphic object selected private void SelectAimGraphic(IPresentationImage presentationImage, string aimUid) { IOverlayGraphicsProvider imageGraphicsProvider = presentationImage as IOverlayGraphicsProvider; if (imageGraphicsProvider != null) { foreach (IGraphic graphic in imageGraphicsProvider.OverlayGraphics) { IAimGraphic aimGraphic = graphic as IAimGraphic; if (aimGraphic != null && aimGraphic.AimAnnotation.UniqueIdentifier == aimUid) { IDecoratorGraphic decoratorGraphic = aimGraphic as IDecoratorGraphic; if (decoratorGraphic != null) { presentationImage.SelectedGraphic = decoratorGraphic.DecoratedGraphic as ISelectableGraphic; presentationImage.FocussedGraphic = decoratorGraphic.DecoratedGraphic as IFocussableGraphic; if (presentationImage.SelectedGraphic != null) { presentationImage.SelectedGraphic.Selected = true; } break; } } } } }
private void SetSelectedGraphic(ISelectableGraphic graphic, string defaultText) { IAimGraphic aimGraphic = graphic == null || graphic.ParentGraphic == null ? null : graphic.ParentGraphic as IAimGraphic; this.SelectedAnnotation = aimGraphic == null ? null : aimGraphic.AimAnnotation; }
private void SetSelectedAnnotation(ISelectableGraphic graphic) { IAimGraphic aimGraphic = graphic == null || graphic.ParentGraphic == null ? null : graphic.ParentGraphic as IAimGraphic; this.SelectedAnnotation = aimGraphic == null ? null : aimGraphic.AimAnnotation; }
private void SetSelectedAnnotation(ISelectableGraphic graphic) { IAimGraphic aimGraphic = graphic == null || graphic.ParentGraphic == null ? null : graphic.ParentGraphic as IAimGraphic; SelectedAnnotationUid = aimGraphic == null ? null : aimGraphic.AnnotationUid; }
// makes requested Graphic object selected private void SelectAimGraphic(IPresentationImage presentationImage, string aimUid) { IOverlayGraphicsProvider imageGraphicsProvider = presentationImage as IOverlayGraphicsProvider; if (imageGraphicsProvider != null) { bool isFound = false; foreach (IGraphic graphic in imageGraphicsProvider.OverlayGraphics) { IAimGraphic aimGraphic = graphic as IAimGraphic; if (aimGraphic != null && aimGraphic.AnnotationUid == aimUid) { IDecoratorGraphic decoratorGraphic = aimGraphic as IDecoratorGraphic; if (decoratorGraphic != null) { presentationImage.SelectedGraphic = decoratorGraphic.DecoratedGraphic as ISelectableGraphic; presentationImage.FocussedGraphic = decoratorGraphic.DecoratedGraphic as IFocussableGraphic; if (presentationImage.SelectedGraphic != null) { presentationImage.SelectedGraphic.Selected = true; isFound = true; } break; } } } if (!isFound) { // Unselect current selection if (presentationImage.SelectedGraphic != null) { presentationImage.SelectedGraphic.Selected = false; } presentationImage.SelectedGraphic = null; presentationImage.FocussedGraphic = null; } } }