private void OnMouseButtonStateChange(MouseEventArgs e, bool isMouseDown)
        {
            bool flag = true;

            if (base.IsOnDropDown)
            {
                ToolStripDropDown currentParentDropDown = base.GetCurrentParentDropDown();
                base.SupportsRightClick = currentParentDropDown.GetFirstDropDown() is ContextMenuStrip;
            }
            else
            {
                flag = !base.DropDown.Visible;
                base.SupportsRightClick = false;
            }
            if ((e.Button == MouseButtons.Left) || ((e.Button == MouseButtons.Right) && base.SupportsRightClick))
            {
                if (isMouseDown && flag)
                {
                    this.openMouseId = (base.ParentInternal == null) ? ((byte)0) : base.ParentInternal.GetMouseId();
                    base.ShowDropDown(true);
                }
                else if (!isMouseDown && !flag)
                {
                    byte num         = (base.ParentInternal == null) ? ((byte)0) : base.ParentInternal.GetMouseId();
                    int  openMouseId = this.openMouseId;
                    if (num != openMouseId)
                    {
                        this.openMouseId = 0;
                        ToolStripManager.ModalMenuFilter.CloseActiveDropDown(base.DropDown, ToolStripDropDownCloseReason.AppClicked);
                        base.Select();
                    }
                }
            }
        }