ComponentFactory.Krypton.Toolkit.ViewDrawMenuRadioButton.Closing C# (CSharp) Method

Closing() public method

Raises the Closing event on the provider.
public Closing ( CancelEventArgs cea ) : void
cea CancelEventArgs A CancelEventArgs containing the event data.
return void
        public void Closing(CancelEventArgs cea)
        {
            _provider.OnClosing(cea);
        }

Usage Example

Esempio n. 1
0
        private void PressMenuRadioButton(bool keyboard)
        {
            if (keyboard)
            {
                _menuRadioButton.ViewDrawContent.ElementState = PaletteState.Pressed;
                PerformNeedPaint();
                Application.DoEvents();
            }

            // Should we automatically try and close the context menu stack
            if (_menuRadioButton.KryptonContextMenuRadioButton.AutoClose)
            {
                // Is the menu capable of being closed?
                if (_menuRadioButton.CanCloseMenu)
                {
                    // Ask the original context menu definition, if we can close
                    CancelEventArgs cea = new CancelEventArgs();
                    _menuRadioButton.Closing(cea);

                    if (!cea.Cancel)
                    {
                        // Close the menu from display and pass in the item clicked as the reason
                        _menuRadioButton.Close(new CloseReasonEventArgs(ToolStripDropDownCloseReason.ItemClicked));
                    }
                }
            }

            // Do we need to automatically change the checked state?
            if (_menuRadioButton.KryptonContextMenuRadioButton.AutoCheck)
            {
                // We only alter state if it is currently not checked
                if (!_menuRadioButton.KryptonContextMenuRadioButton.Checked)
                {
                    _menuRadioButton.KryptonContextMenuRadioButton.Checked = true;
                }
            }

            if (Click != null)
            {
                Click(this, EventArgs.Empty);
            }

            if (keyboard)
            {
                UpdateTarget();
                PerformNeedPaint();
            }
        }