elementpushbutton.cs

来自「破解的飞信源代码」· CS 代码 · 共 68 行

CS
68
字号
namespace Imps.Client.Pc
{
    using System;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    public class ElementPushButton : ElementButton
    {
        public int _buttonID;

        public event EventHandler ButtonDown;

        public override void OnMouseDown(MouseEventArgs e)
        {
            if (base.State != ElementButton.ButtonState.STATE_DISABLE)
            {
                if (!this.Down)
                {
                    this.OnMouseClick(e);
                }
                this.Down = true;
            }
        }

        public override void OnMouseHover(MouseEventArgs e)
        {
            base.OnMouseHover(e);
        }

        public override void OnMouseLeave(MouseEventArgs e)
        {
            if (!this.Down)
            {
                base.OnMouseLeave(e);
            }
        }

        public override void OnMouseUp(MouseEventArgs e)
        {
        }

        public bool Down
        {
            get
            {
                return base._down;
            }
            set
            {
                base._down = value;
                if (base._down)
                {
                    base.State = ElementButton.ButtonState.STATE_DOWN;
                    if (this.ButtonDown != null)
                    {
                        this.ButtonDown(this, EventArgs.Empty);
                    }
                }
                else
                {
                    base.State = ElementButton.ButtonState.STATE_NORMAL;
                }
            }
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?