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

.net编程

开发平台:

C#

  1. namespace Sunisoft.IrisSkin
  2. {
  3.     using System;
  4.     using System.Drawing;
  5.     using System.Windows.Forms;
  6.     internal class x867b4abdb49f9449 : Control
  7.     {
  8.         private Control x246c0c54671f3f3e;
  9.         private bool x71ee84dfc52c8c16;
  10.         private SkinEngine xdc87e2b99332cd4a;
  11.         public x867b4abdb49f9449(Control host, SkinEngine engine, bool hScroll)
  12.         {
  13.             this.x246c0c54671f3f3e = host;
  14.             this.xdc87e2b99332cd4a = engine;
  15.             this.x71ee84dfc52c8c16 = hScroll;
  16.             if (host.Parent != null)
  17.             {
  18.                 if ((host.Parent is TableLayoutPanel) || (host.Parent is SplitContainer))
  19.                 {
  20.                     if (host.Parent.Parent != null)
  21.                     {
  22.                         host.Parent.Parent.Controls.Add(this);
  23.                     }
  24.                 }
  25.                 else
  26.                 {
  27.                     host.Parent.Controls.Add(this);
  28.                 }
  29.             }
  30.             base.Bounds = host.Bounds;
  31.             base.BringToFront();
  32.         }
  33.         public void Repaint(x40255b11ef821fa3.SCROLLBARINFO info)
  34.         {
  35.             if ((base.Width > 0) && (base.Height > 0))
  36.             {
  37.                 using (Bitmap bitmap = new Bitmap(base.Width, base.Height))
  38.                 {
  39.                     int num2 = 0;
  40.                     using (Graphics graphics = Graphics.FromImage(bitmap))
  41.                     {
  42.                         Bitmap bitmap2;
  43.                         Rectangle rectangle2;
  44.                         int num;
  45.                         Brush backColorBrush = this.xdc87e2b99332cd4a.Res.ScrollBarRes.BackColorBrush;
  46.                         Rectangle rect = new Rectangle(0, 0, base.Width, base.Height);
  47.                         graphics.FillRectangle(backColorBrush, rect);
  48.                         Rectangle rectangle3 = new Rectangle(0, 0, base.Width, base.Height);
  49.                         if (this.x71ee84dfc52c8c16)
  50.                         {
  51.                             rectangle3.Width = info.rcScrollBar.right - info.rcScrollBar.left;
  52.                             if ((this.x246c0c54671f3f3e.RightToLeft & RightToLeft.Yes) == RightToLeft.Yes)
  53.                             {
  54.                                 rectangle3.X += base.PointToClient(new Point(info.rcScrollBar.left, 0)).X;
  55.                             }
  56.                             num = Math.Min(0x10, rectangle3.Width / 2);
  57.                             bitmap2 = this.xdc87e2b99332cd4a.Res.ScrollBarRes.UpButton[1, num2];
  58.                             rectangle2 = new Rectangle(0, 0, bitmap2.Width, bitmap2.Height);
  59.                             rect = new Rectangle(rectangle3.X, rectangle3.Y, num, rectangle3.Height);
  60.                             graphics.DrawImage(bitmap2, rect, rectangle2, GraphicsUnit.Pixel);
  61.                             bitmap2 = this.xdc87e2b99332cd4a.Res.ScrollBarRes.DownButton[1, num2];
  62.                             rectangle2 = new Rectangle(0, 0, bitmap2.Width, bitmap2.Height);
  63.                             rect = new Rectangle(rectangle3.Right - num, rectangle3.Y, num, rectangle3.Height);
  64.                             graphics.DrawImage(bitmap2, rect, rectangle2, GraphicsUnit.Pixel);
  65.                             if ((((info.rgstate[0] & 0x8000) != 0x8000) && ((info.rgstate[0] & 1) != 1)) && ((info.rcScrollBar.right - info.rcScrollBar.left) > 0x26))
  66.                             {
  67.                                 rect = new Rectangle(info.xyThumbTop + rectangle3.Left, rectangle3.Top, info.xyThumbBottom - info.xyThumbTop, rectangle3.Bottom);
  68.                                 x448fd9ab43628c71.PaintSlider(this.xdc87e2b99332cd4a, graphics, rect, false);
  69.                             }
  70.                         }
  71.                         else
  72.                         {
  73.                             num = Math.Min(0x10, base.Height / 2);
  74.                             bitmap2 = this.xdc87e2b99332cd4a.Res.ScrollBarRes.UpButton[0, num2];
  75.                             rectangle2 = new Rectangle(0, 0, bitmap2.Width, bitmap2.Height);
  76.                             rect = new Rectangle(rectangle3.X, rectangle3.Y, rectangle3.Width, num);
  77.                             graphics.DrawImage(bitmap2, rect, rectangle2, GraphicsUnit.Pixel);
  78.                             bitmap2 = this.xdc87e2b99332cd4a.Res.ScrollBarRes.DownButton[0, num2];
  79.                             rectangle2 = new Rectangle(0, 0, bitmap2.Width, bitmap2.Height);
  80.                             rect = new Rectangle(rectangle3.X, rectangle3.Bottom - num, rectangle3.Width, num);
  81.                             graphics.DrawImage(bitmap2, rect, rectangle2, GraphicsUnit.Pixel);
  82.                             if ((((info.rgstate[0] & 0x8000) != 0x8000) && ((info.rgstate[0] & 1) != 1)) && ((info.rcScrollBar.bottom - info.rcScrollBar.top) > 0x26))
  83.                             {
  84.                                 rect = new Rectangle(rectangle3.Left, info.xyThumbTop, rectangle3.Right, info.xyThumbBottom - info.xyThumbTop);
  85.                                 x448fd9ab43628c71.PaintSlider(this.xdc87e2b99332cd4a, graphics, rect, true);
  86.                             }
  87.                         }
  88.                     }
  89.                     using (Graphics graphics2 = Graphics.FromHwnd(base.Handle))
  90.                     {
  91.                         graphics2.DrawImageUnscaled(bitmap, 0, 0);
  92.                     }
  93.                 }
  94.             }
  95.         }
  96.         protected override void WndProc(ref Message m)
  97.         {
  98.             if (this.x246c0c54671f3f3e != null)
  99.             {
  100.                 int messagePos;
  101.                 uint num2;
  102.                 switch (((uint) m.Msg))
  103.                 {
  104.                     case 0x201:
  105.                         messagePos = x61467fe65a98f20c.GetMessagePos();
  106.                         if (!this.x71ee84dfc52c8c16)
  107.                         {
  108.                             num2 = 7;
  109.                         }
  110.                         else
  111.                         {
  112.                             num2 = 6;
  113.                         }
  114.                         x61467fe65a98f20c.ReleaseCapture();
  115.                         x61467fe65a98f20c.SendMessage(this.x246c0c54671f3f3e.Handle, 0xa1, new IntPtr((long) num2), new IntPtr(messagePos));
  116.                         return;
  117.                     case 0x202:
  118.                         messagePos = x61467fe65a98f20c.GetMessagePos();
  119.                         if (!this.x71ee84dfc52c8c16)
  120.                         {
  121.                             num2 = 7;
  122.                         }
  123.                         else
  124.                         {
  125.                             num2 = 6;
  126.                         }
  127.                         x61467fe65a98f20c.ReleaseCapture();
  128.                         x61467fe65a98f20c.SendMessage(this.x246c0c54671f3f3e.Handle, 0xa2, new IntPtr((long) num2), new IntPtr(messagePos));
  129.                         return;
  130.                     case 0x20a:
  131.                         x61467fe65a98f20c.PostMessage(this.x246c0c54671f3f3e.Handle, (uint) m.Msg, m.WParam, m.LParam);
  132.                         return;
  133.                 }
  134.             }
  135.             base.WndProc(ref m);
  136.             switch (((uint) m.Msg))
  137.             {
  138.                 case 15:
  139.                 case 20:
  140.                     x40255b11ef821fa3.PAINTSTRUCT paintstruct;
  141.                     x61467fe65a98f20c.BeginPaint(base.Handle, out paintstruct);
  142.                     this.x8bc95f030953f87b();
  143.                     x61467fe65a98f20c.EndPaint(base.Handle, ref paintstruct);
  144.                     break;
  145.             }
  146.         }
  147.         protected void x8bc95f030953f87b()
  148.         {
  149.             Rectangle rectangle;
  150.             x40255b11ef821fa3.SCROLLBARINFO psbi = new x40255b11ef821fa3.SCROLLBARINFO();
  151.             psbi.cbSize = 60;
  152.             xae4dd1cafd2eb77c.RECT lpRect = new xae4dd1cafd2eb77c.RECT();
  153.             x61467fe65a98f20c.GetWindowRect(this.x246c0c54671f3f3e.Handle, ref lpRect);
  154.             if (this.x71ee84dfc52c8c16)
  155.             {
  156.                 if (x61467fe65a98f20c.GetScrollBarInfo(this.x246c0c54671f3f3e.Handle, 0xfffffffa, ref psbi))
  157.                 {
  158.                     rectangle = new Rectangle(psbi.rcScrollBar.left - lpRect.left, psbi.rcScrollBar.top - lpRect.top, psbi.rcScrollBar.right - psbi.rcScrollBar.left, psbi.rcScrollBar.bottom - psbi.rcScrollBar.top);
  159.                     if (((rectangle.X >= 0) && (rectangle.Y >= 0)) && ((rectangle.Width > 0) && (rectangle.Height > 0)))
  160.                     {
  161.                         this.Repaint(psbi);
  162.                     }
  163.                 }
  164.             }
  165.             else if (x61467fe65a98f20c.GetScrollBarInfo(base.Handle, 0xfffffffb, ref psbi))
  166.             {
  167.                 rectangle = new Rectangle(psbi.rcScrollBar.left - lpRect.left, psbi.rcScrollBar.top - lpRect.top, psbi.rcScrollBar.right - psbi.rcScrollBar.left, psbi.rcScrollBar.bottom - psbi.rcScrollBar.top);
  168.                 if (((rectangle.X >= 0) && (rectangle.Y >= 0)) && ((rectangle.Width > 0) && (rectangle.Height > 0)))
  169.                 {
  170.                     this.Repaint(psbi);
  171.                 }
  172.             }
  173.         }
  174.     }
  175. }