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

.net编程

开发平台:

C#

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