Пример #1
0
        protected override void UpdateVisibility(IPresentationImage image, bool visible)
        {
            ColorBarCompositeGraphic graphic = GetCompositeColorBarGraphic(image, visible);

            if (graphic != null)
            {
                graphic.Visible = visible;
            }
        }
Пример #2
0
        public override void SetOverlayVisible(IPresentationImage image, bool visible)
        {
            ColorBarCompositeGraphic graphic = GetCompositeScaleGraphic(image, visible);

            if (graphic != null)
            {
                graphic.Visible = visible;
            }
        }
Пример #3
0
        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;
		}
Пример #4
0
		//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;
		}
Пример #5
0
        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);
        }
Пример #6
0
        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);
        }
Пример #7
0
			/// <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);
			}
Пример #8
0
 /// <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);
 }