xfe25d236d92b80ed.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 xfe25d236d92b80ed : xbd3f2493841f18a1
  7.     {
  8.         public xfe25d236d92b80ed(Control control, SkinEngine engine) : base(control, engine)
  9.         {
  10.         }
  11.         protected override void DoInit()
  12.         {
  13.             base.DoInit();
  14.             RadioButton ctrl = (RadioButton) base.Ctrl;
  15.             ctrl.CheckedChanged += new EventHandler(this.x28cd6b6670ead686);
  16.             ctrl.Click += new EventHandler(this.x0e4d5d36f8e3dec9);
  17.             ctrl.Paint += new PaintEventHandler(this.x081d5f69c7c3ccdc);
  18.         }
  19.         protected override void PaintControl()
  20.         {
  21.             if ((base.Ctrl.ClientRectangle.Width > 0) && (base.Ctrl.ClientRectangle.Height > 0))
  22.             {
  23.                 Graphics graphics = Graphics.FromHwnd(base.Ctrl.Handle);
  24.                 this.x8bc95f030953f87b(graphics);
  25.                 graphics.Dispose();
  26.             }
  27.         }
  28.         private void x081d5f69c7c3ccdc(object xe0292b9ed559da7d, PaintEventArgs xfbf34718e704c6bc)
  29.         {
  30.             if (base.CanPaint)
  31.             {
  32.                 this.x8bc95f030953f87b(xfbf34718e704c6bc.Graphics);
  33.             }
  34.         }
  35.         private void x0e4d5d36f8e3dec9(object xe0292b9ed559da7d, EventArgs xfbf34718e704c6bc)
  36.         {
  37.             if (base.CanPaint)
  38.             {
  39.                 this.PaintControl();
  40.             }
  41.         }
  42.         private void x28cd6b6670ead686(object xe0292b9ed559da7d, EventArgs xfbf34718e704c6bc)
  43.         {
  44.             if (base.CanPaint)
  45.             {
  46.                 this.PaintControl();
  47.             }
  48.         }
  49.         private void x6f37a3496a324cf4(Graphics x4b101060f4767186, int x43abf768b4ac7ff4)
  50.         {
  51.             Rectangle rectangle;
  52.             StringFormat format;
  53.             Brush gray;
  54.             RadioButton ctrl = (RadioButton) base.Ctrl;
  55.             x448fd9ab43628c71.CalcLayoutRect(ctrl.TextAlign, ctrl.ClientRectangle, ctrl.RightToLeft, out rectangle, out format);
  56.             if ((ctrl.RightToLeft & RightToLeft.Yes) != RightToLeft.Yes)
  57.             {
  58.                 switch (ctrl.CheckAlign)
  59.                 {
  60.                     case ContentAlignment.TopLeft:
  61.                     case (ContentAlignment.TopCenter | ContentAlignment.TopLeft):
  62.                     case ContentAlignment.MiddleLeft:
  63.                         goto Label_0134;
  64.                     case ContentAlignment.TopCenter:
  65.                     case ContentAlignment.MiddleCenter:
  66.                     case ContentAlignment.BottomCenter:
  67.                         goto Label_0163;
  68.                     case ContentAlignment.TopRight:
  69.                     case ContentAlignment.MiddleRight:
  70.                     case ContentAlignment.BottomRight:
  71.                         rectangle.Width -= x43abf768b4ac7ff4;
  72.                         goto Label_0163;
  73.                 }
  74.             }
  75.             else
  76.             {
  77.                 switch (ctrl.CheckAlign)
  78.                 {
  79.                     case ContentAlignment.TopCenter:
  80.                     case ContentAlignment.MiddleCenter:
  81.                     case ContentAlignment.BottomCenter:
  82.                         goto Label_0163;
  83.                     case ContentAlignment.TopRight:
  84.                     case ContentAlignment.MiddleRight:
  85.                     case ContentAlignment.BottomRight:
  86.                         rectangle.X += x43abf768b4ac7ff4;
  87.                         rectangle.Width -= x43abf768b4ac7ff4;
  88.                         goto Label_0163;
  89.                 }
  90.                 rectangle.Width -= x43abf768b4ac7ff4;
  91.                 goto Label_0163;
  92.             }
  93.         Label_0134:
  94.             rectangle.X += x43abf768b4ac7ff4;
  95.             rectangle.Width -= x43abf768b4ac7ff4;
  96.         Label_0163:
  97.             if (base.ctrlMouseState == xb9506a535e31f22a.MouseDown)
  98.             {
  99.                 x448fd9ab43628c71.OffsetRect(ref rectangle, 1, 1);
  100.             }
  101.             if (base.Ctrl.Enabled)
  102.             {
  103.                 gray = new SolidBrush(base.Ctrl.ForeColor);
  104.             }
  105.             else
  106.             {
  107.                 gray = Brushes.Gray;
  108.             }
  109.             x4b101060f4767186.DrawString(ctrl.Text, ctrl.Font, gray, rectangle, format);
  110.             if (ctrl.Focused)
  111.             {
  112.                 x4b101060f4767186.DrawRectangle(x448fd9ab43628c71.FocusRectanglePen, rectangle.X, rectangle.Y, rectangle.Width - 1, rectangle.Height - 1);
  113.             }
  114.             if (base.Ctrl.Enabled && (gray != null))
  115.             {
  116.                 gray.Dispose();
  117.             }
  118.         }
  119.         private void x8bc95f030953f87b(Graphics x4b101060f4767186)
  120.         {
  121.             RadioButton ctrl = (RadioButton) base.Ctrl;
  122.             int index = 0;
  123.             if (ctrl.Checked)
  124.             {
  125.                 if (ctrl.Enabled)
  126.                 {
  127.                     index = 1;
  128.                 }
  129.                 else
  130.                 {
  131.                     index = 3;
  132.                 }
  133.             }
  134.             else if (ctrl.Enabled)
  135.             {
  136.                 index = 2;
  137.             }
  138.             else
  139.             {
  140.                 index = 4;
  141.             }
  142.             Bitmap image = base.Engine.Res.SplitBitmaps.SKIN2_RADIOBUTTON[index];
  143.             int num2 = Math.Max(image.Width, 13);
  144.             int height = Math.Max(image.Height, 13);
  145.             num2 = Math.Min(num2, 14);
  146.             height = Math.Min(num2, 14);
  147.             Brush brush = base.Engine.Res.Brushes.SKIN2_FORMCOLOR;
  148.             Rectangle destRect = x448fd9ab43628c71.CalcLayoutRect(ctrl.CheckAlign, ctrl.RightToLeft, ctrl.ClientRectangle, num2, height, 0, 0);
  149.             x4b101060f4767186.FillRectangle(brush, ctrl.ClientRectangle);
  150.             Rectangle srcRect = new Rectangle(0, 0, image.Width, image.Height);
  151.             x4b101060f4767186.DrawImage(image, destRect, srcRect, GraphicsUnit.Pixel);
  152.             if (ctrl.Image != null)
  153.             {
  154.                 this.xcea9a0eaf0e83f21(x4b101060f4767186, num2);
  155.             }
  156.             this.x6f37a3496a324cf4(x4b101060f4767186, num2);
  157.         }
  158.         private void xcea9a0eaf0e83f21(Graphics x4b101060f4767186, int x43abf768b4ac7ff4)
  159.         {
  160.             RadioButton ctrl = (RadioButton) base.Ctrl;
  161.             Image image = ctrl.Image;
  162.             if ((image.Height > 0) && (image.Width > 0))
  163.             {
  164.                 Rectangle clientRectangle = ctrl.ClientRectangle;
  165.                 switch (ctrl.CheckAlign)
  166.                 {
  167.                     case ContentAlignment.TopCenter:
  168.                     case ContentAlignment.MiddleCenter:
  169.                     case ContentAlignment.BottomCenter:
  170.                         break;
  171.                     case ContentAlignment.TopRight:
  172.                     case ContentAlignment.MiddleRight:
  173.                     case ContentAlignment.BottomRight:
  174.                         clientRectangle.Width -= x43abf768b4ac7ff4;
  175.                         break;
  176.                     default:
  177.                         clientRectangle.X += x43abf768b4ac7ff4;
  178.                         clientRectangle.Width -= x43abf768b4ac7ff4;
  179.                         break;
  180.                 }
  181.                 Rectangle rect = x448fd9ab43628c71.CalcLayoutRect(ctrl.ImageAlign, ctrl.RightToLeft, clientRectangle, image.Width, image.Height);
  182.                 if (base.ctrlMouseState == xb9506a535e31f22a.MouseDown)
  183.                 {
  184.                     x448fd9ab43628c71.OffsetRect(ref rect, 1, 1);
  185.                 }
  186.                 x4b101060f4767186.DrawImage(image, rect.X, rect.Y, image.Width, image.Height);
  187.             }
  188.         }
  189.         protected override bool ChangeFontColor
  190.         {
  191.             get
  192.             {
  193.                 return true;
  194.             }
  195.         }
  196.     }
  197. }