⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bpanel.cs

📁 破解的飞信源代码
💻 CS
字号:
namespace Imps.Client.Pc.BizControls
{
    using System;
    using System.Drawing;
    using System.Windows.Forms;

    public class BPanel : Panel
    {
        private Color borderColor = Color.FromArgb(0xa4, 170, 220);
        private Color borderInsideColor = Color.White;
        private int borderInsideWidth = 1;
        private int borderWidth = 1;
        private Rectangle rectBackgroundImage;
        private Rectangle rectBorder;
        private Rectangle rectBorderInside;
        private static BPanelStyle style = new BPanelStyle();

        public BPanel()
        {
            base.SetStyle(0x22012, true);
            style.StyleChanged += new EventHandler(this.style_StyleChanged);
            base.Disposed += new EventHandler(this.BPanel_Disposed);
        }

        private void BPanel_Disposed(object sender, EventArgs e)
        {
            style.StyleChanged -= new EventHandler(this.style_StyleChanged);
        }

        private void CalculateRectangles()
        {
            this.rectBorder = new Rectangle(this.BorderWidth / 2, this.BorderWidth / 2, base.Width - this.BorderWidth, base.Height - this.BorderWidth);
            this.rectBorderInside = new Rectangle(this.BorderWidth + (this.BorderInsideWidth / 2), this.BorderWidth + (this.BorderInsideWidth / 2), (base.Width - (this.BorderWidth * 2)) - this.BorderInsideWidth, (base.Height - (this.BorderWidth * 2)) - this.BorderInsideWidth);
            this.rectBackgroundImage = new Rectangle(this.BorderWidth + this.BorderInsideWidth, this.BorderWidth + this.BorderInsideWidth, base.Width - ((this.BorderWidth + this.BorderInsideWidth) * 2), base.Height - ((this.BorderWidth + this.BorderInsideWidth) * 2));
        }

        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            this.CalculateRectangles();
            Graphics graphics = e.Graphics;
            using (Pen pen = new Pen(this.BorderColor, (float) this.BorderWidth))
            {
                graphics.DrawRectangle(pen, this.rectBorder);
                if (this.BorderInsideWidth > 0)
                {
                    pen.Color = this.BorderInsideColor;
                    pen.Width = this.BorderInsideWidth;
                    graphics.DrawRectangle(pen, this.rectBorderInside);
                }
            }
        }

        private void style_StyleChanged(object sender, EventArgs e)
        {
            base.Invalidate();
        }

        public override Color BackColor
        {
            get
            {
                if (Style.UseTheme)
                {
                    return Style.BackColor;
                }
                return base.BackColor;
            }
            set
            {
                base.BackColor = value;
            }
        }

        public override Image BackgroundImage
        {
            get
            {
                if (style.UseTheme)
                {
                    return Style.BackgroundImage;
                }
                return base.BackgroundImage;
            }
            set
            {
                base.BackgroundImage = value;
            }
        }

        public Color BorderColor
        {
            get
            {
                if (Style.UseTheme)
                {
                    return Style.BorderColor;
                }
                return this.borderColor;
            }
            set
            {
                this.borderColor = value;
            }
        }

        public Color BorderInsideColor
        {
            get
            {
                if (Style.UseTheme)
                {
                    return Style.BorderInsideColor;
                }
                return this.borderInsideColor;
            }
            set
            {
                this.borderInsideColor = value;
            }
        }

        public int BorderInsideWidth
        {
            get
            {
                if (Style.UseTheme)
                {
                    return Style.BorderInsideWidth;
                }
                return this.borderInsideWidth;
            }
            set
            {
                this.borderInsideWidth = value;
            }
        }

        public int BorderWidth
        {
            get
            {
                if (Style.UseTheme)
                {
                    return Style.BorderWidth;
                }
                return this.borderWidth;
            }
            set
            {
                this.borderWidth = value;
            }
        }

        public static BPanelStyle Style
        {
            get
            {
                return style;
            }
            set
            {
                style = value;
            }
        }
    }
}

⌨️ 快捷键说明

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