Exemplo n.º 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)
        {
            // Push correct palettes into the view
            if (Enabled)
            {
                _drawDocker.SetPalettes(_stateNormal.Back, _stateNormal.Border);
                _drawContent.SetPalette(_stateNormal.Content);
            }
            else
            {
                _drawDocker.SetPalettes(_stateDisabled.Back, _stateDisabled.Border);
                _drawContent.SetPalette(_stateDisabled.Content);
            }

            _drawDocker.Enabled  = Enabled;
            _drawContent.Enabled = Enabled;

            // Update state to reflect change in enabled state
            _buttonManager.RefreshButtons();

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

            // Let base class fire standard event
            base.OnEnabledChanged(e);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Raises the EnabledChanged event.
        /// </summary>
        /// <param name="e">An EventArgs that contains the event data.</param>
        protected override void OnEnabledChanged(EventArgs e)
        {
            // Push correct palettes into the view
            if (Enabled)
            {
                _drawDocker.SetPalettes(_stateNormal.Back, _stateNormal.Border);
            }
            else
            {
                _drawDocker.SetPalettes(_stateDisabled.Back, _stateDisabled.Border);
            }

            _drawDocker.Enabled = Enabled;

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

            // Let base class fire standard event
            base.OnEnabledChanged(e);
        }