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

.net编程

开发平台:

C#

  1. namespace Sunisoft.IrisSkin
  2. {
  3.     using System;
  4.     using System.Drawing;
  5.     using System.Text;
  6.     using System.Windows.Forms;
  7.     internal class x5b126f5f998c28e9 : NativeWindow
  8.     {
  9.         protected xb9506a535e31f22a ctrlMouseState = xb9506a535e31f22a.None;
  10.         protected SkinEngine Engine;
  11.         public x5b126f5f998c28e9(IntPtr handle, SkinEngine engine)
  12.         {
  13.             this.Engine = engine;
  14.             base.AssignHandle(handle);
  15.         }
  16.         protected virtual void AfterWndProc(ref Message m)
  17.         {
  18.             switch (((uint) m.Msg))
  19.             {
  20.                 case 0x200:
  21.                     if (this.ctrlMouseState != xb9506a535e31f22a.MouseDown)
  22.                     {
  23.                         this.ctrlMouseState = xb9506a535e31f22a.MouseIn;
  24.                     }
  25.                     this.PaintControl();
  26.                     return;
  27.                 case 0x201:
  28.                     this.ctrlMouseState = xb9506a535e31f22a.MouseDown;
  29.                     this.PaintControl();
  30.                     return;
  31.                 case 0x202:
  32.                     this.ctrlMouseState = xb9506a535e31f22a.None;
  33.                     this.PaintControl();
  34.                     return;
  35.                 case 0x2a3:
  36.                     this.ctrlMouseState = xb9506a535e31f22a.None;
  37.                     this.PaintControl();
  38.                     return;
  39.                 case 10:
  40.                     this.PaintControl();
  41.                     return;
  42.                 case 11:
  43.                     break;
  44.                 case 12:
  45.                 case 15:
  46.                     x40255b11ef821fa3.PAINTSTRUCT paintstruct;
  47.                     x61467fe65a98f20c.BeginPaint(base.Handle, out paintstruct);
  48.                     this.PaintControl();
  49.                     x61467fe65a98f20c.EndPaint(base.Handle, ref paintstruct);
  50.                     break;
  51.                 default:
  52.                     return;
  53.             }
  54.         }
  55.         protected virtual bool BeforeWndProc(ref Message m)
  56.         {
  57.             return true;
  58.         }
  59.         protected virtual void PaintControl()
  60.         {
  61.         }
  62.         protected override void WndProc(ref Message m)
  63.         {
  64.             if (this.CanPaint)
  65.             {
  66.                 if (this.BeforeWndProc(ref m))
  67.                 {
  68.                     base.WndProc(ref m);
  69.                 }
  70.                 this.AfterWndProc(ref m);
  71.             }
  72.             else
  73.             {
  74.                 base.WndProc(ref m);
  75.             }
  76.         }
  77.         protected virtual bool CanPaint
  78.         {
  79.             get
  80.             {
  81.                 return this.Engine.RealActive;
  82.             }
  83.         }
  84.         protected virtual Rectangle ClientRectangle
  85.         {
  86.             get
  87.             {
  88.                 Rectangle lpRect = new Rectangle(0, 0, 0, 0);
  89.                 x61467fe65a98f20c.GetClientRect(base.Handle, ref lpRect);
  90.                 return lpRect;
  91.             }
  92.         }
  93.         protected virtual bool Enabled
  94.         {
  95.             get
  96.             {
  97.                 return ((x61467fe65a98f20c.GetWindowLong(base.Handle, -16) & 0x8000000) != 0x8000000);
  98.             }
  99.         }
  100.         protected virtual bool Focused
  101.         {
  102.             get
  103.             {
  104.                 return (x61467fe65a98f20c.GetFocus() == base.Handle);
  105.             }
  106.         }
  107.         protected virtual System.Drawing.Font Font
  108.         {
  109.             get
  110.             {
  111.                 return x448fd9ab43628c71.GetMessageFont();
  112.             }
  113.         }
  114.         protected virtual Color ForeColor
  115.         {
  116.             get
  117.             {
  118.                 return Color.FromKnownColor(KnownColor.ControlText);
  119.             }
  120.         }
  121.         protected virtual int Height
  122.         {
  123.             get
  124.             {
  125.                 xae4dd1cafd2eb77c.RECT lpRect = new xae4dd1cafd2eb77c.RECT();
  126.                 x61467fe65a98f20c.GetClientRect(base.Handle, ref lpRect);
  127.                 return lpRect.bottom;
  128.             }
  129.         }
  130.         protected virtual System.Windows.Forms.RightToLeft RightToLeft
  131.         {
  132.             get
  133.             {
  134.                 if ((x61467fe65a98f20c.GetWindowLong(base.Handle, -20) & 0x1000) != 0x1000)
  135.                 {
  136.                     return System.Windows.Forms.RightToLeft.No;
  137.                 }
  138.                 return System.Windows.Forms.RightToLeft.Yes;
  139.             }
  140.         }
  141.         protected virtual string Text
  142.         {
  143.             get
  144.             {
  145.                 int windowTextLengthA = x61467fe65a98f20c.GetWindowTextLengthA(base.Handle);
  146.                 if (windowTextLengthA > 0)
  147.                 {
  148.                     windowTextLengthA++;
  149.                     StringBuilder lpString = new StringBuilder(windowTextLengthA);
  150.                     x61467fe65a98f20c.GetWindowText(base.Handle, lpString, windowTextLengthA);
  151.                     if (lpString != null)
  152.                     {
  153.                         return lpString.ToString();
  154.                     }
  155.                 }
  156.                 return "";
  157.             }
  158.         }
  159.         protected virtual int Width
  160.         {
  161.             get
  162.             {
  163.                 xae4dd1cafd2eb77c.RECT lpRect = new xae4dd1cafd2eb77c.RECT();
  164.                 x61467fe65a98f20c.GetClientRect(base.Handle, ref lpRect);
  165.                 return lpRect.right;
  166.             }
  167.         }
  168.     }
  169. }