x2edc3f693fe78d2e.cs
上传用户:xlxx0122
上传日期:2015-04-24
资源大小:3904k
文件大小:4k
源码类别:

.net编程

开发平台:

C#

  1. namespace Sunisoft.IrisSkin
  2. {
  3.     using System;
  4.     using System.Drawing;
  5.     using System.Windows.Forms;
  6.     internal class x2edc3f693fe78d2e : xc56e4251b5681836
  7.     {
  8.         public x2edc3f693fe78d2e(Control control, SkinEngine engine) : base(control, engine)
  9.         {
  10.         }
  11.         protected override void AfterWndProc(ref Message m)
  12.         {
  13.             switch (((uint) m.Msg))
  14.             {
  15.                 case 15:
  16.                 case 20:
  17.                     this.PaintControl();
  18.                     break;
  19.             }
  20.             base.AfterWndProc(ref m);
  21.         }
  22.         protected override bool BeforeWndProc(ref Message m)
  23.         {
  24.             return base.BeforeWndProc(ref m);
  25.         }
  26.         protected override void DoInit()
  27.         {
  28.             base.DoInit();
  29.         }
  30.         protected override void PaintControl()
  31.         {
  32.             if (((base.Ctrl.Width > 0) && (base.Ctrl.Height > 0)) && base.CanPaint)
  33.             {
  34.                 base.PaintControl();
  35.                 if (this.PaintBorderLine)
  36.                 {
  37.                     IntPtr windowDC = x61467fe65a98f20c.GetWindowDC(base.Ctrl.Handle);
  38.                     using (Graphics graphics = Graphics.FromHdc(windowDC))
  39.                     {
  40.                         using (Bitmap bitmap = new Bitmap(base.Ctrl.Width, base.Ctrl.Height))
  41.                         {
  42.                             using (Graphics graphics2 = Graphics.FromImage(bitmap))
  43.                             {
  44.                                 this.x8bc95f030953f87b(graphics2);
  45.                                 graphics.DrawImageUnscaled(bitmap, 0, 0);
  46.                             }
  47.                         }
  48.                         x61467fe65a98f20c.ReleaseDC(base.Ctrl.Handle, windowDC);
  49.                     }
  50.                 }
  51.             }
  52.         }
  53.         private void x32475e142481d30b(object xe0292b9ed559da7d, PaintEventArgs xfbf34718e704c6bc)
  54.         {
  55.             this.PaintControl();
  56.         }
  57.         private void x8bc95f030953f87b(Graphics x4b101060f4767186)
  58.         {
  59.             if (this.PaintBorder)
  60.             {
  61.                 Pen pen;
  62.                 Brush brush = base.Engine.Res.Brushes.SKIN2_CONTROLBORDERCOLOR;
  63.                 Rectangle lpRect = new Rectangle(0, 0, 0, 0);
  64.                 using (pen = new Pen(brush, 1f))
  65.                 {
  66.                     x61467fe65a98f20c.GetWindowRect(base.Ctrl.Handle, ref lpRect);
  67.                     lpRect.Width -= lpRect.X + 1;
  68.                     lpRect.Height -= lpRect.Y + 1;
  69.                     lpRect.X = 0;
  70.                     lpRect.Y = 0;
  71.                     x4b101060f4767186.DrawRectangle(pen, lpRect);
  72.                 }
  73.                 if (this.BorderWidth > 0)
  74.                 {
  75.                     if (this.EnableState)
  76.                     {
  77.                         pen = new Pen(base.Ctrl.BackColor, (float) this.BorderWidth);
  78.                     }
  79.                     else
  80.                     {
  81.                         pen = new Pen(Color.FromKnownColor(KnownColor.Control), (float) this.BorderWidth);
  82.                     }
  83.                     lpRect.X += this.BorderWidth;
  84.                     lpRect.Y += this.BorderWidth;
  85.                     lpRect.Width -= this.BorderWidth + 1;
  86.                     lpRect.Height -= this.BorderWidth + 1;
  87.                     x4b101060f4767186.DrawLine(pen, lpRect.Left, 1, lpRect.Left, lpRect.Bottom);
  88.                     x4b101060f4767186.DrawLine(pen, lpRect.Left, lpRect.Top, lpRect.Right, lpRect.Top);
  89.                     pen.Dispose();
  90.                 }
  91.             }
  92.         }
  93.         protected virtual int BorderWidth
  94.         {
  95.             get
  96.             {
  97.                 return 0;
  98.             }
  99.         }
  100.         protected virtual bool EnableState
  101.         {
  102.             get
  103.             {
  104.                 return base.Ctrl.Enabled;
  105.             }
  106.         }
  107.         protected virtual bool PaintBorder
  108.         {
  109.             get
  110.             {
  111.                 return true;
  112.             }
  113.         }
  114.         protected virtual bool PaintBorderLine
  115.         {
  116.             get
  117.             {
  118.                 return true;
  119.             }
  120.         }
  121.     }
  122. }