ComponentFactory.Krypton.Toolkit.ViewLayoutMenuItemSelect.Close C# (CSharp) Метод

Close() публичный Метод

Raises the Close event on the provider.
public Close ( CloseReasonEventArgs e ) : void
e CloseReasonEventArgs A CancelEventArgs containing the event data.
Результат void
        public void Close(CloseReasonEventArgs e)
        {
            _provider.OnClose(e);
        }

Usage Example

Пример #1
0
        private void OnItemClick(object sender, MouseEventArgs e)
        {
            // Set new selection index
            _imageSelect.SelectedIndex = _imageIndex;

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

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

            _needPaint(this, new NeedLayoutEventArgs(true));
        }