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

.net编程

开发平台:

C#

  1. namespace Sunisoft.IrisSkin
  2. {
  3.     using System;
  4.     using System.Drawing;
  5.     using System.Windows.Forms;
  6.     internal class xc3d08931d227ebfe : x8917d01b98173f4c
  7.     {
  8.         public xc3d08931d227ebfe(Control control, SkinEngine engine) : base(control, engine)
  9.         {
  10.             if (this.x0e7ffd184973f9bc)
  11.             {
  12.                 uint windowLong = x61467fe65a98f20c.GetWindowLong(base.Handle, -20);
  13.                 if ((windowLong & 0x400000) == 0x400000)
  14.                 {
  15.                     windowLong -= 0x400000;
  16.                 }
  17.                 x61467fe65a98f20c.SetWindowLong(base.Handle, -20, windowLong);
  18.             }
  19.         }
  20.         protected override bool BeforeWndProc(ref Message m)
  21.         {
  22.             switch (((uint) m.Msg))
  23.             {
  24.                 case 15:
  25.                 {
  26.                     x40255b11ef821fa3.PAINTSTRUCT lpPaint = new x40255b11ef821fa3.PAINTSTRUCT();
  27.                     x61467fe65a98f20c.BeginPaint(base.Ctrl.Handle, out lpPaint);
  28.                     this.PaintControl();
  29.                     x61467fe65a98f20c.EndPaint(base.Ctrl.Handle, ref lpPaint);
  30.                     m.Result = IntPtr.Zero;
  31.                     return false;
  32.                 }
  33.                 case 0x402:
  34.                     this.PaintControl();
  35.                     break;
  36.             }
  37.             return base.BeforeWndProc(ref m);
  38.         }
  39.         protected override void OnCurrentSkinChanged(object sender, SkinChangedEventArgs e)
  40.         {
  41.             base.OnCurrentSkinChanged(sender, e);
  42.             if (!base.CanPaint)
  43.             {
  44.                 if (this.x0e7ffd184973f9bc)
  45.                 {
  46.                     uint dwNewLong = x61467fe65a98f20c.GetWindowLong(base.Handle, -20) & 0x400000;
  47.                     x61467fe65a98f20c.SetWindowLong(base.Handle, -20, dwNewLong);
  48.                 }
  49.             }
  50.             else if (this.x0e7ffd184973f9bc)
  51.             {
  52.                 uint windowLong = x61467fe65a98f20c.GetWindowLong(base.Handle, -20);
  53.                 if ((windowLong & 0x400000) == 0x400000)
  54.                 {
  55.                     windowLong -= 0x400000;
  56.                 }
  57.                 x61467fe65a98f20c.SetWindowLong(base.Handle, -20, windowLong);
  58.             }
  59.         }
  60.         protected override void PaintControl()
  61.         {
  62.             if (((base.Ctrl.ClientRectangle.Width > 0) && (base.Ctrl.ClientRectangle.Height > 0)) && base.CanPaint)
  63.             {
  64.                 ProgressBar ctrl = (ProgressBar) base.Ctrl;
  65.                 using (Bitmap bitmap = new Bitmap(base.Ctrl.Width, base.Ctrl.Height))
  66.                 {
  67.                     using (Graphics graphics = Graphics.FromImage(bitmap))
  68.                     {
  69.                         this.x8bc95f030953f87b(graphics);
  70.                     }
  71.                     using (Graphics graphics2 = Graphics.FromHwnd(base.Handle))
  72.                     {
  73.                         if (this.x0e7ffd184973f9bc)
  74.                         {
  75.                             bitmap.RotateFlip(RotateFlipType.RotateNoneFlipX);
  76.                             graphics2.DrawImageUnscaled(bitmap, 0, 0);
  77.                         }
  78.                         else
  79.                         {
  80.                             graphics2.DrawImageUnscaled(bitmap, 0, 0);
  81.                         }
  82.                     }
  83.                 }
  84.             }
  85.         }
  86.         private void x8bc95f030953f87b(Graphics x4b101060f4767186)
  87.         {
  88.             ProgressBar ctrl = (ProgressBar) base.Ctrl;
  89.             Rectangle clientRectangle = ctrl.ClientRectangle;
  90.             int width = ctrl.Width;
  91.             int height = ctrl.Height;
  92.             int num5 = 2;
  93.             Bitmap image = base.Engine.Res.Bitmaps.SKIN2_PROGRESSBAR1;
  94.             int x = image.Width;
  95.             Rectangle srcRect = new Rectangle(0, 0, image.Width, num5);
  96.             Rectangle destRect = srcRect;
  97.             x4b101060f4767186.DrawImage(image, destRect, srcRect, GraphicsUnit.Pixel);
  98.             srcRect = new Rectangle(0, image.Height - num5, image.Width, num5);
  99.             destRect = new Rectangle(0, height - num5, image.Width, num5);
  100.             x4b101060f4767186.DrawImage(image, destRect, srcRect, GraphicsUnit.Pixel);
  101.             srcRect = Rectangle.FromLTRB(0, num5, image.Width, image.Height - num5);
  102.             destRect = new Rectangle(0, num5, image.Width, height - num5);
  103.             x4b101060f4767186.DrawImage(image, destRect, srcRect, GraphicsUnit.Pixel);
  104.             image = base.Engine.Res.Bitmaps.SKIN2_PROGRESSBAR4;
  105.             int right = width - image.Width;
  106.             srcRect = new Rectangle(0, 0, image.Width, num5);
  107.             destRect = new Rectangle(width - image.Width, 0, image.Width, num5);
  108.             x4b101060f4767186.DrawImage(image, destRect, srcRect, GraphicsUnit.Pixel);
  109.             srcRect = new Rectangle(0, image.Height - num5, image.Width, num5);
  110.             destRect = new Rectangle(width - image.Width, height - num5, image.Width, num5);
  111.             x4b101060f4767186.DrawImage(image, destRect, srcRect, GraphicsUnit.Pixel);
  112.             srcRect = Rectangle.FromLTRB(0, num5, image.Width, image.Height - num5);
  113.             destRect = new Rectangle(width - image.Width, num5, image.Width, height - num5);
  114.             x4b101060f4767186.DrawImage(image, destRect, srcRect, GraphicsUnit.Pixel);
  115.             if (ctrl.Maximum != ctrl.Minimum)
  116.             {
  117.                 clientRectangle = new Rectangle(x, 0, ((ctrl.Value - ctrl.Minimum) * (right - x)) / (ctrl.Maximum - ctrl.Minimum), ctrl.Height);
  118.                 image = base.Engine.Res.Bitmaps.SKIN2_PROGRESSBAR2;
  119.                 srcRect = new Rectangle(0, 0, image.Width, num5);
  120.                 destRect = Rectangle.FromLTRB(clientRectangle.Left, clientRectangle.Top, clientRectangle.Right, num5);
  121.                 x4b101060f4767186.DrawImage(image, destRect, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, GraphicsUnit.Pixel, x448fd9ab43628c71.DrawImageAttrTileX);
  122.                 srcRect = new Rectangle(0, image.Height - num5, image.Width, num5);
  123.                 destRect = Rectangle.FromLTRB(clientRectangle.Left, clientRectangle.Bottom - num5, clientRectangle.Right, clientRectangle.Bottom);
  124.                 x4b101060f4767186.DrawImage(image, destRect, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, GraphicsUnit.Pixel, x448fd9ab43628c71.DrawImageAttrTileX);
  125.                 srcRect = Rectangle.FromLTRB(0, num5, image.Width, image.Height - num5);
  126.                 destRect = Rectangle.FromLTRB(clientRectangle.Left, clientRectangle.Top + num5, clientRectangle.Right, clientRectangle.Bottom - num5);
  127.                 x4b101060f4767186.DrawImage(image, destRect, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, GraphicsUnit.Pixel, x448fd9ab43628c71.DrawImageAttrTileX);
  128.                 clientRectangle = Rectangle.FromLTRB(clientRectangle.Right, clientRectangle.Top, right, clientRectangle.Bottom);
  129.                 image = base.Engine.Res.Bitmaps.SKIN2_PROGRESSBAR3;
  130.                 srcRect = new Rectangle(0, 0, image.Width, num5);
  131.                 destRect = Rectangle.FromLTRB(clientRectangle.Left, clientRectangle.Top, clientRectangle.Right, num5);
  132.                 x4b101060f4767186.DrawImage(image, destRect, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, GraphicsUnit.Pixel, x448fd9ab43628c71.DrawImageAttrTileX);
  133.                 srcRect = new Rectangle(0, image.Height - num5, image.Width, num5);
  134.                 destRect = Rectangle.FromLTRB(clientRectangle.Left, clientRectangle.Bottom - num5, clientRectangle.Right, clientRectangle.Bottom);
  135.                 x4b101060f4767186.DrawImage(image, destRect, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, GraphicsUnit.Pixel, x448fd9ab43628c71.DrawImageAttrTileX);
  136.                 srcRect = Rectangle.FromLTRB(0, num5, image.Width, image.Height - num5);
  137.                 destRect = Rectangle.FromLTRB(clientRectangle.Left, clientRectangle.Top + num5, clientRectangle.Right, clientRectangle.Bottom - num5);
  138.                 x4b101060f4767186.DrawImage(image, destRect, srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height, GraphicsUnit.Pixel, x448fd9ab43628c71.DrawImageAttrTileX);
  139.             }
  140.         }
  141.         private bool x0e7ffd184973f9bc
  142.         {
  143.             get
  144.             {
  145.                 ProgressBar ctrl = (ProgressBar) base.Ctrl;
  146.                 return (ctrl.RightToLeftLayout && ((ctrl.RightToLeft & RightToLeft.Yes) == RightToLeft.Yes));
  147.             }
  148.         }
  149.     }
  150. }