ComponentFactory.Krypton.Toolkit.MonthCalendarController.MouseUp C# (CSharp) Method

MouseUp() public method

Mouse button has been released in the view.
public MouseUp ( Control c, Point pt, MouseButtons button ) : void
c System.Windows.Forms.Control Reference to the source control instance.
pt Point Mouse position relative to control.
button MouseButtons Mouse button released.
return void
        public virtual void MouseUp(Control c, Point pt, MouseButtons button)
        {
            // If the mouse is currently captured
            if (_captured)
            {
                // Not capturing mouse input anymore
                _captured = false;

                // Only interested in left mouse being released
                if (button == MouseButtons.Left)
                {
                    if ((_monthCalendar != null) && _monthCalendar.AutoClose && (_months.Provider != null))
                    {
                        // If the mouse was pressed down on a day entry, then we close down on mouse up
                        if (_selectionStart != DateTime.MinValue)
                        {
                            // Is the menu capable of being closed?
                            if (_months.Provider.ProviderCanCloseMenu)
                            {
                                // Ask the original context menu definition, if we can close
                                CancelEventArgs cea = new CancelEventArgs();
                                _months.Provider.OnClosing(cea);

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