📄 element.cs
字号:
namespace Imps.Client.Pc
{
using System;
using System.Drawing;
using System.Runtime.CompilerServices;
using System.Windows.Forms;
public abstract class Element : IDisposable
{
protected bool _handleMouse = true;
public Control _host;
protected string _id;
public System.Drawing.Point _location;
public Size _size;
public EStyleBase _style;
protected bool _visible = true;
public event EventHandler Click;
public event EventHandler Enter;
public event EventHandler Leave;
public virtual void Dispose()
{
}
public virtual void OnMouseClick(MouseEventArgs e)
{
if (this.Click != null)
{
this.Click(this, e);
}
}
public virtual void OnMouseDown(MouseEventArgs e)
{
}
public virtual void OnMouseHover(MouseEventArgs e)
{
if (this.Enter != null)
{
this.Enter(this, e);
}
}
public virtual void OnMouseLeave(MouseEventArgs e)
{
if (this.Leave != null)
{
this.Leave(this, e);
}
}
public virtual void OnMouseUp(MouseEventArgs e)
{
}
public virtual void OnPaint(PaintEventArgs e)
{
}
public virtual void OnSizeChanged(int w, int h)
{
}
protected void RaiseInvalidate(bool forceRedraw)
{
if (this._host != null)
{
this._host.Invalidate(this.Rectangle);
if (forceRedraw)
{
this._host.Update();
}
}
}
public bool HandleMouse
{
get
{
return this._handleMouse;
}
set
{
this._handleMouse = value;
}
}
public string NameID
{
get
{
return this._id;
}
set
{
this._id = value;
}
}
public System.Drawing.Rectangle Rectangle
{
get
{
return new System.Drawing.Rectangle(this._location, this._size);
}
}
public bool Visible
{
get
{
return this._visible;
}
set
{
if (this._visible != value)
{
this._visible = value;
this.RaiseInvalidate(false);
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -