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

.net编程

开发平台:

C#

  1. namespace Sunisoft.IrisSkin
  2. {
  3.     using System;
  4.     using System.Drawing;
  5.     using System.Windows.Forms;
  6.     internal class x52106a473347a957 : x5b126f5f998c28e9
  7.     {
  8.         private int x01b557925841ae51;
  9.         private Timer x420067493d7ebb36;
  10.         private bool x5e45bc5ff748c78c;
  11.         public x52106a473347a957(IntPtr handle, SkinEngine engine) : base(handle, engine)
  12.         {
  13.             this.x420067493d7ebb36 = new Timer();
  14.             this.x420067493d7ebb36.Interval = 0x8a;
  15.             this.x420067493d7ebb36.Tick += new EventHandler(this.x0f7fdae17d8cfcb5);
  16.             this.x420067493d7ebb36.Start();
  17.         }
  18.         protected override bool BeforeWndProc(ref Message m)
  19.         {
  20.             switch (((uint) m.Msg))
  21.             {
  22.                 case 0xf3:
  23.                     this.x01b557925841ae51 = m.WParam.ToInt32();
  24.                     return false;
  25.                 case 0x101:
  26.                     if ((this.x01b557925841ae51 == 1) && (m.WParam.ToInt32() == 0x20))
  27.                     {
  28.                         x61467fe65a98f20c.PostMessage(x61467fe65a98f20c.GetParent(base.Handle), 0x111, new IntPtr(x61467fe65a98f20c.GetDlgCtrlID(base.Handle)), base.Handle);
  29.                     }
  30.                     break;
  31.                 case 0x202:
  32.                     if (this.x01b557925841ae51 == 1)
  33.                     {
  34.                         x61467fe65a98f20c.PostMessage(x61467fe65a98f20c.GetParent(base.Handle), 0x111, new IntPtr(x61467fe65a98f20c.GetDlgCtrlID(base.Handle)), base.Handle);
  35.                     }
  36.                     break;
  37.             }
  38.             return base.BeforeWndProc(ref m);
  39.         }
  40.         protected override void PaintControl()
  41.         {
  42.             if (this.CanPaint && ((this.Width > 0) && (this.Height > 0)))
  43.             {
  44.                 using (Graphics graphics = Graphics.FromHwnd(base.Handle))
  45.                 {
  46.                     this.x8bc95f030953f87b(graphics);
  47.                 }
  48.             }
  49.         }
  50.         private void x0f7fdae17d8cfcb5(object xe0292b9ed559da7d, EventArgs xfbf34718e704c6bc)
  51.         {
  52.             if (!this.x5e45bc5ff748c78c)
  53.             {
  54.                 this.PaintControl();
  55.                 this.x5e45bc5ff748c78c = true;
  56.             }
  57.             xb9506a535e31f22a none = xb9506a535e31f22a.None;
  58.             Point lpPoint = new Point(0, 0);
  59.             xae4dd1cafd2eb77c.RECT lpRect = new xae4dd1cafd2eb77c.RECT();
  60.             if (x61467fe65a98f20c.GetCursorPos(ref lpPoint))
  61.             {
  62.                 x61467fe65a98f20c.GetWindowRect(base.Handle, ref lpRect);
  63.                 if (x448fd9ab43628c71.InRect(lpPoint, new Rectangle(lpRect.left, lpRect.top, lpRect.right - lpRect.left, lpRect.bottom - lpRect.top)))
  64.                 {
  65.                     none = xb9506a535e31f22a.MouseIn;
  66.                 }
  67.                 else
  68.                 {
  69.                     none = xb9506a535e31f22a.None;
  70.                 }
  71.                 if (base.ctrlMouseState != none)
  72.                 {
  73.                     base.ctrlMouseState = none;
  74.                     this.PaintControl();
  75.                 }
  76.             }
  77.         }
  78.         private void x6b515e4773b2f185(Graphics x4b101060f4767186, Bitmap x5ce6bc2fb6fe458d)
  79.         {
  80.             x4b101060f4767186.DrawImage(x5ce6bc2fb6fe458d, this.ClientRectangle, this.ClientRectangle, GraphicsUnit.Pixel);
  81.         }
  82.         private void x6b515e4773b2f185(Graphics x4b101060f4767186, Bitmap x5ce6bc2fb6fe458d, string x1c2743f354837549, Font x26094932cf7a9139, Rectangle x59dcf7372713ec60)
  83.         {
  84.             Brush gray = null;
  85.             x4b101060f4767186.DrawImage(x5ce6bc2fb6fe458d, this.ClientRectangle, this.ClientRectangle, GraphicsUnit.Pixel);
  86.             if ((x1c2743f354837549 != null) && (x1c2743f354837549 != ""))
  87.             {
  88.                 if (!this.Enabled)
  89.                 {
  90.                     gray = Brushes.Gray;
  91.                 }
  92.                 else
  93.                 {
  94.                     gray = new SolidBrush(this.ForeColor);
  95.                 }
  96.                 if (base.ctrlMouseState == xb9506a535e31f22a.MouseDown)
  97.                 {
  98.                     x448fd9ab43628c71.OffsetRect(ref x59dcf7372713ec60, 1, 1);
  99.                 }
  100.                 x4b101060f4767186.DrawString(x1c2743f354837549, x26094932cf7a9139, gray, x59dcf7372713ec60);
  101.             }
  102.             if ((gray != null) && this.Enabled)
  103.             {
  104.                 gray.Dispose();
  105.             }
  106.         }
  107.         private void x6f37a3496a324cf4(Graphics x4b101060f4767186, string xb41faee6912a2313)
  108.         {
  109.             Rectangle rectangle;
  110.             StringFormat format;
  111.             Brush gray;
  112.             x448fd9ab43628c71.CalcLayoutRect(ContentAlignment.MiddleCenter, this.ClientRectangle, this.RightToLeft, out rectangle, out format);
  113.             if (this.x01b557925841ae51 == 1)
  114.             {
  115.                 x448fd9ab43628c71.OffsetRect(ref rectangle, this.x01b557925841ae51, this.x01b557925841ae51);
  116.             }
  117.             if (this.Enabled)
  118.             {
  119.                 gray = base.Engine.Res.Brushes.SKIN2_BUTTONFONTCOLOR;
  120.             }
  121.             else
  122.             {
  123.                 gray = Brushes.Gray;
  124.             }
  125.             x4b101060f4767186.DrawString(xb41faee6912a2313, this.Font, gray, rectangle, format);
  126.         }
  127.         private void x8bc95f030953f87b(Graphics x4b101060f4767186)
  128.         {
  129.             int ctrlMouseState = (int) base.ctrlMouseState;
  130.             if (this.x01b557925841ae51 == 1)
  131.             {
  132.                 ctrlMouseState = 3;
  133.             }
  134.             if (!this.Enabled)
  135.             {
  136.                 ctrlMouseState = 1;
  137.             }
  138.             Bitmap src = base.Engine.Res.SplitBitmaps.SKIN2_BUTTON[ctrlMouseState];
  139.             using (Bitmap bitmap2 = new Bitmap(this.Width, this.Height))
  140.             {
  141.                 using (Graphics graphics = Graphics.FromImage(bitmap2))
  142.                 {
  143.                     Brush brush = base.Engine.Res.Brushes.SKIN2_FORMCOLOR;
  144.                     graphics.FillRectangle(brush, this.ClientRectangle);
  145.                     x448fd9ab43628c71.SplitDraw(src, graphics, this.ClientRectangle);
  146.                     string text = this.Text;
  147.                     if ((text != null) && (text != ""))
  148.                     {
  149.                         this.x6f37a3496a324cf4(graphics, text);
  150.                     }
  151.                     if (this.Focused)
  152.                     {
  153.                         Rectangle rect = Rectangle.FromLTRB(this.ClientRectangle.Left + 4, this.ClientRectangle.Top + 4, this.ClientRectangle.Right - 5, this.ClientRectangle.Bottom - 5);
  154.                         if (base.ctrlMouseState == xb9506a535e31f22a.MouseDown)
  155.                         {
  156.                             x448fd9ab43628c71.OffsetRect(ref rect, 1, 1);
  157.                         }
  158.                         graphics.DrawRectangle(x448fd9ab43628c71.FocusRectanglePen, rect);
  159.                     }
  160.                     this.x6b515e4773b2f185(x4b101060f4767186, bitmap2);
  161.                 }
  162.             }
  163.         }
  164.     }
  165. }