SetInherit() public method

Gets and sets the palette to inherit from.
public SetInherit ( IPaletteBack paletteBack ) : void
paletteBack IPaletteBack
return void
Ejemplo n.º 1
0
        /// <summary>
        /// Update the source palettes for drawing.
        /// </summary>
        /// <param name="paletteBack">Palette source for the background.</param>
        /// <param name="paletteBorder">Palette source for the border.</param>
        /// <param name="paletteMetric">Palette source for the metric.</param>
        public virtual void SetPalettes(IPaletteBack paletteBack,
                                        IPaletteBorder paletteBorder,
                                        IPaletteMetric paletteMetric)
        {
            Debug.Assert(paletteBorder != null);
            Debug.Assert(paletteBack != null);

            // Use newly provided palettes
            _paletteBack = paletteBack;
            _paletteBackDraw.SetInherit(paletteBack);
            _paletteBackLight.Inherit = paletteBack;

            // If not using a forced override decorator, then just store the new border palette
            // otherwise we update the decorator with the palette as the new inheritance to use
            if (_borderForced == null)
            {
                _paletteBorder = paletteBorder;
            }
            else
            {
                _borderForced.SetInherit(paletteBorder);
            }

            _paletteMetric = paletteMetric;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Update the source palette for drawing.
        /// </summary>
        /// <param name="palette">Palette source for drawing details.</param>
        public void SetPalettes(PaletteBorderEdge palette)
        {
            Debug.Assert(palette != null);

            // Inherit from the newly provided palette
            _palette = palette;
            _borderForced.SetInherit(palette);

            // Give the forced palette to the base
            base.SetPalettes(_borderForced);
        }