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

.net编程

开发平台:

C#

  1. namespace Sunisoft.IrisSkin
  2. {
  3.     using System;
  4.     using System.Drawing;
  5.     using System.Windows.Forms;
  6.     internal class xd8e48d4d4b6a016e : x2edc3f693fe78d2e
  7.     {
  8.         private StringFormat x5786461d089b10a0;
  9.         private const int xc2b2889221bc8c5e = 20;
  10.         public xd8e48d4d4b6a016e(Control control, SkinEngine engine) : base(control, engine)
  11.         {
  12.             this.x5786461d089b10a0 = new StringFormat();
  13.             this.x5786461d089b10a0.LineAlignment = StringAlignment.Center;
  14.             this.x5786461d089b10a0.FormatFlags = StringFormatFlags.LineLimit;
  15.         }
  16.         protected override bool BeforeWndProc(ref Message m)
  17.         {
  18.             switch (((uint) m.Msg))
  19.             {
  20.                 case 15:
  21.                     x40255b11ef821fa3.PAINTSTRUCT paintstruct;
  22.                     x61467fe65a98f20c.BeginPaint(base.Ctrl.Handle, out paintstruct);
  23.                     this.PaintControl();
  24.                     x61467fe65a98f20c.EndPaint(base.Ctrl.Handle, ref paintstruct);
  25.                     break;
  26.                 case 20:
  27.                     return false;
  28.             }
  29.             return base.BeforeWndProc(ref m);
  30.         }
  31.         protected override void PaintControl()
  32.         {
  33.             if (((base.Ctrl.ClientRectangle.Width > 0) && (base.Ctrl.ClientRectangle.Height > 0)) && base.CanPaint)
  34.             {
  35.                 ComboBox ctrl = (ComboBox) base.Ctrl;
  36.                 Rectangle rect = new Rectangle(0, 0, ctrl.Width, ctrl.Height);
  37.                 if (ctrl.DropDownStyle == ComboBoxStyle.Simple)
  38.                 {
  39.                     base.PaintControl();
  40.                 }
  41.                 else
  42.                 {
  43.                     IntPtr windowDC = x61467fe65a98f20c.GetWindowDC(base.Ctrl.Handle);
  44.                     using (Graphics graphics = Graphics.FromHdc(windowDC))
  45.                     {
  46.                         if (ctrl.DropDownStyle == ComboBoxStyle.DropDownList)
  47.                         {
  48.                             if (ctrl.Enabled)
  49.                             {
  50.                                 using (Brush brush = new SolidBrush(base.Ctrl.BackColor))
  51.                                 {
  52.                                     graphics.FillRectangle(brush, rect);
  53.                                     goto Label_0285;
  54.                                 }
  55.                             }
  56.                             using (Brush brush2 = new SolidBrush(Color.FromKnownColor(KnownColor.Control)))
  57.                             {
  58.                                 graphics.FillRectangle(brush2, rect);
  59.                                 goto Label_0285;
  60.                             }
  61.                         }
  62.                         rect.Height -= 4;
  63.                         rect.Width -= 4;
  64.                         rect.X += 2;
  65.                         rect.Y += 2;
  66.                         if (ctrl.Enabled)
  67.                         {
  68.                             using (Brush brush3 = new SolidBrush(base.Ctrl.BackColor))
  69.                             {
  70.                                 using (Pen pen = new Pen(brush3, 2f))
  71.                                 {
  72.                                     graphics.DrawRectangle(pen, rect);
  73.                                     if ((ctrl.RightToLeft & RightToLeft.Yes) == RightToLeft.Yes)
  74.                                     {
  75.                                         graphics.DrawLine(pen, (rect.Left + 20) - 3, rect.Top, (rect.Left + 20) - 3, rect.Bottom);
  76.                                     }
  77.                                     else
  78.                                     {
  79.                                         graphics.DrawLine(pen, (rect.Right - 20) + 3, rect.Top, (rect.Right - 20) + 3, rect.Bottom);
  80.                                     }
  81.                                 }
  82.                                 goto Label_0285;
  83.                             }
  84.                         }
  85.                         using (Brush brush4 = new SolidBrush(Color.FromKnownColor(KnownColor.Control)))
  86.                         {
  87.                             using (Pen pen2 = new Pen(brush4, 2f))
  88.                             {
  89.                                 graphics.DrawRectangle(pen2, rect);
  90.                                 if ((ctrl.RightToLeft & RightToLeft.Yes) == RightToLeft.Yes)
  91.                                 {
  92.                                     graphics.DrawLine(pen2, (rect.Left + 20) - 3, rect.Top, (rect.Left + 20) - 3, rect.Bottom);
  93.                                 }
  94.                                 else
  95.                                 {
  96.                                     graphics.DrawLine(pen2, (rect.Right - 20) + 3, rect.Top, (rect.Right - 20) + 3, rect.Bottom);
  97.                                 }
  98.                             }
  99.                         }
  100.                     Label_0285:
  101.                         using (Bitmap bitmap = new Bitmap(base.Ctrl.Width, base.Ctrl.Height))
  102.                         {
  103.                             using (Graphics graphics2 = Graphics.FromImage(bitmap))
  104.                             {
  105.                                 this.x8bc95f030953f87b(graphics2);
  106.                             }
  107.                             graphics.DrawImageUnscaled(bitmap, 0, 0);
  108.                         }
  109.                         if (ctrl.DropDownStyle == ComboBoxStyle.DropDownList)
  110.                         {
  111.                             StringFormat format = new StringFormat();
  112.                             format.Alignment = StringAlignment.Near;
  113.                             if ((ctrl.RightToLeft & RightToLeft.Yes) == RightToLeft.Yes)
  114.                             {
  115.                                 format.FormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.DirectionRightToLeft;
  116.                                 rect.X += 20;
  117.                                 rect.Width -= 20;
  118.                             }
  119.                             else
  120.                             {
  121.                                 format.FormatFlags = StringFormatFlags.LineLimit;
  122.                                 rect.X += 2;
  123.                                 rect.Width -= 20;
  124.                             }
  125.                             format.LineAlignment = StringAlignment.Center;
  126.                             using (Brush brush5 = new SolidBrush(ctrl.ForeColor))
  127.                             {
  128.                                 graphics.DrawString(ctrl.Text, ctrl.Font, brush5, rect, format);
  129.                             }
  130.                         }
  131.                     }
  132.                     x61467fe65a98f20c.ReleaseDC(base.Handle, windowDC);
  133.                 }
  134.             }
  135.         }
  136.         private void x7be4a5b4e2519d4d()
  137.         {
  138.             if ((base.Ctrl.ClientRectangle.Width > 0) && (base.Ctrl.ClientRectangle.Height > 0))
  139.             {
  140.                 ComboBox ctrl = (ComboBox) base.Ctrl;
  141.                 if (ctrl.DropDownStyle != ComboBoxStyle.Simple)
  142.                 {
  143.                     IntPtr windowDC = x61467fe65a98f20c.GetWindowDC(base.Ctrl.Handle);
  144.                     Rectangle rect = new Rectangle(0, 0, ctrl.Width, ctrl.Height);
  145.                     using (Graphics graphics = Graphics.FromHdc(windowDC))
  146.                     {
  147.                         if (ctrl.DropDownStyle == ComboBoxStyle.DropDownList)
  148.                         {
  149.                             if (ctrl.Enabled)
  150.                             {
  151.                                 using (Brush brush = new SolidBrush(base.Ctrl.BackColor))
  152.                                 {
  153.                                     graphics.FillRectangle(brush, rect);
  154.                                     goto Label_01A4;
  155.                                 }
  156.                             }
  157.                             using (Brush brush2 = new SolidBrush(Color.FromKnownColor(KnownColor.Control)))
  158.                             {
  159.                                 graphics.FillRectangle(brush2, rect);
  160.                                 goto Label_01A4;
  161.                             }
  162.                         }
  163.                         rect.Height -= 4;
  164.                         rect.Width -= 4;
  165.                         rect.X += 2;
  166.                         rect.Y += 2;
  167.                         if (ctrl.Enabled)
  168.                         {
  169.                             using (Brush brush3 = new SolidBrush(base.Ctrl.BackColor))
  170.                             {
  171.                                 using (new Pen(brush3, 2f))
  172.                                 {
  173.                                     graphics.DrawRectangle(Pens.Red, rect);
  174.                                 }
  175.                                 goto Label_01A4;
  176.                             }
  177.                         }
  178.                         using (Brush brush4 = new SolidBrush(Color.FromKnownColor(KnownColor.Control)))
  179.                         {
  180.                             using (new Pen(brush4, 2f))
  181.                             {
  182.                                 graphics.DrawRectangle(Pens.Red, rect);
  183.                             }
  184.                         }
  185.                     Label_01A4:
  186.                         if (ctrl.DropDownStyle == ComboBoxStyle.DropDownList)
  187.                         {
  188.                             StringFormat format = new StringFormat();
  189.                             format.Alignment = StringAlignment.Near;
  190.                             if ((ctrl.RightToLeft & RightToLeft.Yes) == RightToLeft.Yes)
  191.                             {
  192.                                 format.FormatFlags = StringFormatFlags.LineLimit | StringFormatFlags.DirectionRightToLeft;
  193.                                 if (ctrl.DropDownStyle == ComboBoxStyle.DropDownList)
  194.                                 {
  195.                                     rect.Width--;
  196.                                 }
  197.                             }
  198.                             else
  199.                             {
  200.                                 format.FormatFlags = StringFormatFlags.LineLimit;
  201.                                 if (ctrl.DropDownStyle == ComboBoxStyle.DropDownList)
  202.                                 {
  203.                                     rect.X++;
  204.                                 }
  205.                             }
  206.                             format.LineAlignment = StringAlignment.Center;
  207.                             using (Brush brush5 = new SolidBrush(ctrl.ForeColor))
  208.                             {
  209.                                 graphics.DrawString(ctrl.Text, ctrl.Font, brush5, rect, format);
  210.                             }
  211.                         }
  212.                     }
  213.                     x61467fe65a98f20c.ReleaseDC(base.Handle, windowDC);
  214.                 }
  215.             }
  216.         }
  217.         private void x8bc95f030953f87b(Graphics x4b101060f4767186)
  218.         {
  219.             Rectangle clientRectangle;
  220.             ComboBox ctrl = (ComboBox) base.Ctrl;
  221.             using (Pen pen = new Pen(base.Engine.Res.Brushes.SKIN2_CONTROLBORDERCOLOR, 1f))
  222.             {
  223.                 clientRectangle = ctrl.ClientRectangle;
  224.                 clientRectangle.Width--;
  225.                 clientRectangle.Height--;
  226.                 x4b101060f4767186.DrawRectangle(pen, clientRectangle);
  227.             }
  228.             if ((ctrl.RightToLeft & RightToLeft.Yes) == RightToLeft.Yes)
  229.             {
  230.                 clientRectangle = new Rectangle(0, 0, 20, ctrl.Height);
  231.             }
  232.             else
  233.             {
  234.                 clientRectangle = new Rectangle(ctrl.Width - 20, 0, 20, ctrl.Height);
  235.             }
  236.             clientRectangle.X += 2;
  237.             clientRectangle.Y += 2;
  238.             clientRectangle.Width -= 5;
  239.             clientRectangle.Height -= 5;
  240.             Brush brush = base.Engine.Res.Brushes.SKIN2_FORMCOLOR;
  241.             x4b101060f4767186.FillRectangle(brush, clientRectangle);
  242.             using (Pen pen2 = new Pen(base.Engine.Res.Brushes.SKIN2_CONTROLBORDERCOLOR, 1f))
  243.             {
  244.                 x4b101060f4767186.DrawRectangle(pen2, clientRectangle);
  245.             }
  246.             x448fd9ab43628c71.DrawArrowDown(x4b101060f4767186, (clientRectangle.X + 10) - 5, (clientRectangle.Y + (ctrl.Height / 2)) - 3, ctrl.Enabled);
  247.         }
  248.         protected override bool CanScroll
  249.         {
  250.             get
  251.             {
  252.                 return false;
  253.             }
  254.         }
  255.         protected override bool ChangeBackColor
  256.         {
  257.             get
  258.             {
  259.                 return false;
  260.             }
  261.         }
  262.     }
  263. }