protected override void UpdateVisibility(IPresentationImage image, bool visible) { ColorBarCompositeGraphic graphic = GetCompositeColorBarGraphic(image, visible); if (graphic != null) { graphic.Visible = visible; } }
public override void SetOverlayVisible(IPresentationImage image, bool visible) { ColorBarCompositeGraphic graphic = GetCompositeScaleGraphic(image, visible); if (graphic != null) { graphic.Visible = visible; } }
private static ColorBarCompositeGraphic GetCompositeColorBarGraphic(IPresentationImage image, bool createIfNull) { var applicationGraphicsProvider = image as IApplicationGraphicsProvider; if (image is IColorMapProvider && applicationGraphicsProvider != null) { var applicationGraphics = applicationGraphicsProvider.ApplicationGraphics; var graphic = applicationGraphics.OfType<ColorBarCompositeGraphic>().FirstOrDefault(); if (graphic == null && createIfNull) applicationGraphics.Add(graphic = new ColorBarCompositeGraphic()); return graphic; } return null; }
//TODO (CR Sept 2010): GetCompositeColorBarGraphic? private static ColorBarCompositeGraphic GetCompositeScaleGraphic(IPresentationImage image, bool createIfNull) { if (image is IColorMapProvider && image is IApplicationGraphicsProvider) { GraphicCollection applicationGraphics = ((IApplicationGraphicsProvider) image).ApplicationGraphics; ColorBarCompositeGraphic graphic = (ColorBarCompositeGraphic) CollectionUtils.SelectFirst(applicationGraphics, g => g is ColorBarCompositeGraphic); if (graphic == null && createIfNull) applicationGraphics.Add(graphic = new ColorBarCompositeGraphic()); return graphic; } return null; }
private static ColorBarCompositeGraphic GetCompositeColorBarGraphic(IPresentationImage image, bool createIfNull) { if (image is IColorMapProvider && image is IApplicationGraphicsProvider) { GraphicCollection applicationGraphics = ((IApplicationGraphicsProvider)image).ApplicationGraphics; ColorBarCompositeGraphic graphic = (ColorBarCompositeGraphic)CollectionUtils.SelectFirst(applicationGraphics, g => g is ColorBarCompositeGraphic); if (graphic == null && createIfNull) { applicationGraphics.Add(graphic = new ColorBarCompositeGraphic()); } return(graphic); } return(null); }
private static ColorBarCompositeGraphic GetCompositeColorBarGraphic(IPresentationImage image, bool createIfNull) { var applicationGraphicsProvider = image as IApplicationGraphicsProvider; if (image is IColorMapProvider && applicationGraphicsProvider != null) { var applicationGraphics = applicationGraphicsProvider.ApplicationGraphics; var graphic = applicationGraphics.OfType <ColorBarCompositeGraphic>().FirstOrDefault(); if (graphic == null && createIfNull) { applicationGraphics.Add(graphic = new ColorBarCompositeGraphic()); } return(graphic); } return(null); }
/// <summary> /// Cloning constructor. /// </summary> /// <param name="source">The source object from which to clone.</param> /// <param name="context">The cloning context object.</param> protected ColorBarCompositeGraphic(ColorBarCompositeGraphic source, ICloningContext context) { context.CloneFields(source, this); }