ComponentFactory.Krypton.Toolkit.ViewDrawPanel.SetPalettes C# (CSharp) Method

SetPalettes() public method

Update the source palettes for drawing.
public SetPalettes ( IPaletteBack paletteBack ) : void
paletteBack IPaletteBack Palette source for the background.
return void
        public void SetPalettes(IPaletteBack paletteBack)
        {
            Debug.Assert(paletteBack != null);

            // Use newly provided palettes
            _paletteBack = paletteBack;
        }

Usage Example

Example #1
0
        /// <summary>
        /// Raises the EnabledChanged event.
        /// </summary>
        /// <param name="e">An EventArgs that contains the event data.</param>
        protected override void OnEnabledChanged(EventArgs e)
        {
            // Cache the new state
            if (Enabled)
            {
                _stateCurrent = _stateNormal;
                _state        = PaletteState.Normal;
            }
            else
            {
                _stateCurrent = _stateDisabled;
                _state        = PaletteState.Disabled;
            }

            // Push correct palettes into the view
            _drawPanel.SetPalettes(_stateCurrent);

            // Update with latest enabled state
            _drawPanel.Enabled = Enabled;

            // Change in enabled state requires a layout and repaint
            PerformNeedPaint(true);

            // Let base class fire standard event
            base.OnEnabledChanged(e);
        }
All Usage Examples Of ComponentFactory.Krypton.Toolkit.ViewDrawPanel::SetPalettes