Advertisement
iJorgePc

ColdTheme

Nov 14th, 2018
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 56.37 KB | None | 0 0
  1. using Microsoft.VisualBasic.CompilerServices;
  2. using System;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Diagnostics;
  7. using System.Drawing;
  8. using System.Drawing.Drawing2D;
  9. using System.Drawing.Text;
  10. using System.Linq;
  11. using System.Runtime.CompilerServices;
  12. using System.Text;
  13. using System.Threading;
  14. using System.Threading.Tasks;
  15. using System.Windows.Forms;
  16.  
  17. namespace themesforcs
  18. {
  19.     public enum MouseState : byte
  20.     {
  21.         None = 0,
  22.         Hover = 1,
  23.         Down = 2,
  24.         Block = 3
  25.     }
  26.     [StandardModule]
  27.     internal sealed class Functions
  28.     {
  29.         public static Point CenterText(string Text, Font Font, int Width, int Height)
  30.         {
  31.             checked
  32.             {
  33.                 int x = (int)Math.Round(unchecked((double)Width / 2.0 - (double)TextRenderer.MeasureText(Text, Font).Width / 2.0));
  34.                 int y = (int)Math.Round(unchecked((double)Height / 2.0 - (double)TextRenderer.MeasureText(Text, Font).Height / 2.0));
  35.                 Point result = new Point(x, y);
  36.                 return result;
  37.             }
  38.         }
  39.         public static Point LeftText(string Text, Font Font, int Width, int Height)
  40.         {
  41.             int x = 3;
  42.             checked
  43.             {
  44.                 int num = (int)Math.Round(unchecked((double)Height / 2.0 - (double)TextRenderer.MeasureText(Text, Font).Height / 2.0));
  45.                 Point result = new Point(x, num - 2);
  46.                 return result;
  47.             }
  48.         }
  49.         public static LinearGradientBrush DrawGradient(int Width, int Height, MouseState State = MouseState.None)
  50.         {
  51.             bool flag = State == MouseState.None;
  52.             LinearGradientBrush linearGradientBrush;
  53.             if (flag)
  54.             {
  55.                 linearGradientBrush = new LinearGradientBrush(new Point(0, Height), new Point(Width, Height), Color.FromArgb(255, 202, 18), Color.FromArgb(210, 160, 39));
  56.             }
  57.             else
  58.             {
  59.                 bool flag2 = State == MouseState.Hover;
  60.                 if (flag2)
  61.                 {
  62.                     linearGradientBrush = new LinearGradientBrush(new Point(0, Height), new Point(Width, Height), Color.FromArgb(220, 255, 202, 18), Color.FromArgb(220, 210, 160, 39));
  63.                 }
  64.                 else
  65.                 {
  66.                     bool flag3 = State == MouseState.Down;
  67.                     if (flag3)
  68.                     {
  69.                         linearGradientBrush = new LinearGradientBrush(new Point(0, Height), new Point(Width, Height), Color.FromArgb(210, 160, 39), Color.FromArgb(255, 202, 18));
  70.                     }
  71.                     else
  72.                     {
  73.                         linearGradientBrush = new LinearGradientBrush(new Point(0, Height), new Point(Width, Height), Color.FromArgb(255, 202, 18), Color.FromArgb(210, 160, 39));
  74.                     }
  75.                 }
  76.             }
  77.             linearGradientBrush.RotateTransform(90f);
  78.             return linearGradientBrush;
  79.         }
  80.     }
  81.     internal class ColdForm : ContainerControl
  82.     {
  83.         private bool Down;
  84.         private int MoveHeight;
  85.         private Point MousePoint;
  86.         public Font mFont;
  87.         protected override void OnCreateControl()
  88.         {
  89.             base.ParentForm.FormBorderStyle = FormBorderStyle.None;
  90.             base.ParentForm.AllowTransparency = true;
  91.             base.ParentForm.TransparencyKey = Color.Fuchsia;
  92.             this.Dock = DockStyle.Fill;
  93.             base.Invalidate();
  94.         }
  95.         protected override void OnMouseDown(MouseEventArgs e)
  96.         {
  97.             base.OnMouseDown(e);
  98.             bool flag = e.Button == MouseButtons.Left & new Rectangle(0, 0, base.Width, this.MoveHeight).Contains(e.Location);
  99.             if (flag)
  100.             {
  101.                 this.Down = true;
  102.                 this.MousePoint = e.Location;
  103.             }
  104.         }
  105.         protected override void OnMouseUp(MouseEventArgs e)
  106.         {
  107.             base.OnMouseUp(e);
  108.             this.Down = false;
  109.         }
  110.         protected override void OnMouseMove(MouseEventArgs e)
  111.         {
  112.             base.OnMouseMove(e);
  113.             bool down = this.Down;
  114.             if (down)
  115.             {
  116.                 base.Parent.Location = Control.MousePosition - (Size)this.MousePoint;
  117.             }
  118.         }
  119.         public ColdForm()
  120.         {
  121.             this.Down = false;
  122.             this.MoveHeight = 30;
  123.             this.MousePoint = new Point(0, 0);
  124.             this.mFont = new Font("Segoe UI", 10f);
  125.             this.Font = this.mFont;
  126.         }
  127.         protected override void OnPaint(PaintEventArgs e)
  128.         {
  129.             base.OnPaint(e);
  130.             checked
  131.             {
  132.                 using (Graphics graphics = e.Graphics)
  133.                 {
  134.                     graphics.Clear(Color.White);
  135.                     graphics.FillRectangle(Functions.DrawGradient(50, base.Height, MouseState.None), new Rectangle(new Point(0, 0), new Size(base.Width, 25)));
  136.                     graphics.FillRectangle(new SolidBrush(Color.FromArgb(218, 218, 218)), new Rectangle(0, 25, base.Width, base.Height - 25));
  137.                     graphics.DrawString(this.Text, this.mFont, new SolidBrush(Color.FromArgb(0, 0, 0)), Functions.LeftText(this.Text, this.mFont, base.Width, this.MoveHeight));
  138.                     graphics.DrawLine(Pens.Black, new Point(base.Width, 25), new Point(0, 25));
  139.                     graphics.DrawLine(Pens.Black, new Point(base.Width, 0), new Point(0, 0));
  140.                     graphics.DrawLine(Pens.Black, new Point(0, base.Height), new Point(0, 0));
  141.                     graphics.DrawLine(Pens.Black, new Point(base.Width - 1, 0), new Point(base.Width - 1, base.Height));
  142.                     graphics.DrawLine(Pens.Black, new Point(base.Width, base.Height - 1), new Point(0, base.Height - 1));
  143.                 }
  144.             }
  145.         }
  146.         protected override void OnSizeChanged(EventArgs e)
  147.         {
  148.             base.OnSizeChanged(e);
  149.             base.Refresh();
  150.         }
  151.         protected override void OnEnter(EventArgs e)
  152.         {
  153.             base.OnLocationChanged(e);
  154.         }
  155.     }
  156.     [StandardModule]
  157.     internal sealed class RoundRectangle
  158.     {
  159.         public static GraphicsPath RoundRect(Rectangle Rectangle, int Curve)
  160.         {
  161.             GraphicsPath graphicsPath = new GraphicsPath();
  162.             checked
  163.             {
  164.                 int num = Curve * 2;
  165.                 graphicsPath.AddArc(new Rectangle(Rectangle.X, Rectangle.Y, num, num), -180f, 90f);
  166.                 graphicsPath.AddArc(new Rectangle(Rectangle.Width - num + Rectangle.X, Rectangle.Y, num, num), -90f, 90f);
  167.                 graphicsPath.AddArc(new Rectangle(Rectangle.Width - num + Rectangle.X, Rectangle.Height - num + Rectangle.Y, num, num), 0f, 90f);
  168.                 graphicsPath.AddArc(new Rectangle(Rectangle.X, Rectangle.Height - num + Rectangle.Y, num, num), 90f, 90f);
  169.                 graphicsPath.AddLine(new Point(Rectangle.X, Rectangle.Height - num + Rectangle.Y), new Point(Rectangle.X, Curve + Rectangle.Y));
  170.                 return graphicsPath;
  171.             }
  172.         }
  173.         public static GraphicsPath RoundRect(int X, int Y, int Width, int Height, int Curve)
  174.         {
  175.             Rectangle rectangle = new Rectangle(X, Y, Width, Height);
  176.             GraphicsPath graphicsPath = new GraphicsPath();
  177.             checked
  178.             {
  179.                 int num = Curve * 2;
  180.                 graphicsPath.AddArc(new Rectangle(rectangle.X, rectangle.Y, num, num), -180f, 90f);
  181.                 graphicsPath.AddArc(new Rectangle(rectangle.Width - num + rectangle.X, rectangle.Y, num, num), -90f, 90f);
  182.                 graphicsPath.AddArc(new Rectangle(rectangle.Width - num + rectangle.X, rectangle.Height - num + rectangle.Y, num, num), 0f, 90f);
  183.                 graphicsPath.AddArc(new Rectangle(rectangle.X, rectangle.Height - num + rectangle.Y, num, num), 90f, 90f);
  184.                 graphicsPath.AddLine(new Point(rectangle.X, rectangle.Height - num + rectangle.Y), new Point(rectangle.X, Curve + rectangle.Y));
  185.                 return graphicsPath;
  186.             }
  187.         }
  188.         public static GraphicsPath RoundedTopRect(Rectangle Rectangle, int Curve)
  189.         {
  190.             GraphicsPath graphicsPath = new GraphicsPath();
  191.             checked
  192.             {
  193.                 int num = Curve * 2;
  194.                 graphicsPath.AddArc(new Rectangle(Rectangle.X, Rectangle.Y, num, num), -180f, 90f);
  195.                 graphicsPath.AddArc(new Rectangle(Rectangle.Width - num + Rectangle.X, Rectangle.Y, num, num), -90f, 90f);
  196.                 graphicsPath.AddLine(new Point(Rectangle.X + Rectangle.Width, Rectangle.Y + num), new Point(Rectangle.X + Rectangle.Width, Rectangle.Y + Rectangle.Height - 1));
  197.                 graphicsPath.AddLine(new Point(Rectangle.X, Rectangle.Height - 1 + Rectangle.Y), new Point(Rectangle.X, Rectangle.Y + Curve));
  198.                 return graphicsPath;
  199.             }
  200.         }
  201.     }
  202.     [DefaultEvent("ValueChanged")]
  203.     internal class ColdTrackBar : Control
  204.     {
  205.         public enum ValueDivisor
  206.         {
  207.             By1 = 1,
  208.             By10 = 10,
  209.             By100 = 100,
  210.             By1000 = 1000
  211.         }
  212.         public delegate void ValueChangedEventHandler();
  213.         private GraphicsPath PipeBorder;
  214.         private GraphicsPath FillValue;
  215.         private Rectangle TrackBarHandleRect;
  216.         private bool Cap;
  217.         private int ValueDrawer;
  218.         private Size ThumbSize;
  219.         private Rectangle TrackThumb;
  220.         private int _Minimum;
  221.         private int _Maximum;
  222.         private int _Value;
  223.         private bool _DrawValueString;
  224.         private bool _JumpToMouse;
  225.         private ColdTrackBar.ValueDivisor DividedValue;
  226.         [DebuggerBrowsable(DebuggerBrowsableState.Never), CompilerGenerated]
  227.         private ColdTrackBar.ValueChangedEventHandler ValueChangedEvent;
  228.         public event ColdTrackBar.ValueChangedEventHandler ValueChanged
  229.         {
  230.             [CompilerGenerated]
  231.             add
  232.             {
  233.                 ColdTrackBar.ValueChangedEventHandler valueChangedEventHandler = this.ValueChangedEvent;
  234.                 ColdTrackBar.ValueChangedEventHandler valueChangedEventHandler2;
  235.                 do
  236.                 {
  237.                     valueChangedEventHandler2 = valueChangedEventHandler;
  238.                     ColdTrackBar.ValueChangedEventHandler value2 = (ColdTrackBar.ValueChangedEventHandler)Delegate.Combine(valueChangedEventHandler2, value);
  239.                     valueChangedEventHandler = Interlocked.CompareExchange<ColdTrackBar.ValueChangedEventHandler>(ref this.ValueChangedEvent, value2, valueChangedEventHandler2);
  240.                 }
  241.                 while (valueChangedEventHandler != valueChangedEventHandler2);
  242.             }
  243.             [CompilerGenerated]
  244.             remove
  245.             {
  246.                 ColdTrackBar.ValueChangedEventHandler valueChangedEventHandler = this.ValueChangedEvent;
  247.                 ColdTrackBar.ValueChangedEventHandler valueChangedEventHandler2;
  248.                 do
  249.                 {
  250.                     valueChangedEventHandler2 = valueChangedEventHandler;
  251.                     ColdTrackBar.ValueChangedEventHandler value2 = (ColdTrackBar.ValueChangedEventHandler)Delegate.Remove(valueChangedEventHandler2, value);
  252.                     valueChangedEventHandler = Interlocked.CompareExchange<ColdTrackBar.ValueChangedEventHandler>(ref this.ValueChangedEvent, value2, valueChangedEventHandler2);
  253.                 }
  254.                 while (valueChangedEventHandler != valueChangedEventHandler2);
  255.             }
  256.         }
  257.         public int Minimum
  258.         {
  259.             get
  260.             {
  261.                 return this._Minimum;
  262.             }
  263.             set
  264.             {
  265.                 bool flag = value >= this._Maximum;
  266.                 if (flag)
  267.                 {
  268.                     value = checked(this._Maximum - 10);
  269.                 }
  270.                 bool flag2 = this._Value < value;
  271.                 if (flag2)
  272.                 {
  273.                     this._Value = value;
  274.                 }
  275.                 this._Minimum = value;
  276.                 base.Invalidate();
  277.             }
  278.         }
  279.         public int Maximum
  280.         {
  281.             get
  282.             {
  283.                 return this._Maximum;
  284.             }
  285.             set
  286.             {
  287.                 bool flag = value <= this._Minimum;
  288.                 if (flag)
  289.                 {
  290.                     value = checked(this._Minimum + 10);
  291.                 }
  292.                 bool flag2 = this._Value > value;
  293.                 if (flag2)
  294.                 {
  295.                     this._Value = value;
  296.                 }
  297.                 this._Maximum = value;
  298.                 base.Invalidate();
  299.             }
  300.         }
  301.         public int Value
  302.         {
  303.             get
  304.             {
  305.                 return this._Value;
  306.             }
  307.             set
  308.             {
  309.                 bool flag = this._Value != value;
  310.                 if (flag)
  311.                 {
  312.                     bool flag2 = value < this._Minimum;
  313.                     if (flag2)
  314.                     {
  315.                         this._Value = this._Minimum;
  316.                     }
  317.                     else
  318.                     {
  319.                         bool flag3 = value > this._Maximum;
  320.                         if (flag3)
  321.                         {
  322.                             this._Value = this._Maximum;
  323.                         }
  324.                         else
  325.                         {
  326.                             this._Value = value;
  327.                         }
  328.                     }
  329.                     base.Invalidate();
  330.                     ColdTrackBar.ValueChangedEventHandler valueChangedEvent = this.ValueChangedEvent;
  331.                     if (valueChangedEvent != null)
  332.                     {
  333.                         valueChangedEvent();
  334.                     }
  335.                 }
  336.             }
  337.         }
  338.         public ColdTrackBar.ValueDivisor ValueDivison
  339.         {
  340.             get
  341.             {
  342.                 return this.DividedValue;
  343.             }
  344.             set
  345.             {
  346.                 this.DividedValue = value;
  347.                 base.Invalidate();
  348.             }
  349.         }
  350.         [Browsable(false)]
  351.         public float ValueToSet
  352.         {
  353.             get
  354.             {
  355.                 return (float)((double)this._Value / (double)this.DividedValue);
  356.             }
  357.             set
  358.             {
  359.                 this.Value = checked((int)Math.Round((double)unchecked(value * (float)this.DividedValue)));
  360.             }
  361.         }
  362.         public bool JumpToMouse
  363.         {
  364.             get
  365.             {
  366.                 return this._JumpToMouse;
  367.             }
  368.             set
  369.             {
  370.                 this._JumpToMouse = value;
  371.                 base.Invalidate();
  372.             }
  373.         }
  374.         public bool DrawValueString
  375.         {
  376.             get
  377.             {
  378.                 return this._DrawValueString;
  379.             }
  380.             set
  381.             {
  382.                 this._DrawValueString = value;
  383.                 bool drawValueString = this._DrawValueString;
  384.                 if (drawValueString)
  385.                 {
  386.                     base.Height = 35;
  387.                 }
  388.                 else
  389.                 {
  390.                     base.Height = 22;
  391.                 }
  392.                 base.Invalidate();
  393.             }
  394.         }
  395.         protected override void OnMouseMove(MouseEventArgs e)
  396.         {
  397.             base.OnMouseMove(e);
  398.             checked
  399.             {
  400.                 bool flag = this.Cap && e.X > -1 && e.X < base.Width + 1;
  401.                 if (flag)
  402.                 {
  403.                     this.Value = this._Minimum + (int)Math.Round(unchecked((double)checked(this._Maximum - this._Minimum) * ((double)e.X / (double)base.Width)));
  404.                 }
  405.             }
  406.         }
  407.         protected override void OnMouseDown(MouseEventArgs e)
  408.         {
  409.             base.OnMouseDown(e);
  410.             bool flag = e.Button == MouseButtons.Left;
  411.             checked
  412.             {
  413.                 if (flag)
  414.                 {
  415.                     this.ValueDrawer = (int)Math.Round(unchecked(checked((double)(this._Value - this._Minimum) / (double)(this._Maximum - this._Minimum)) * (double)checked(base.Width - 11)));
  416.                     this.TrackBarHandleRect = new Rectangle(this.ValueDrawer, 0, 25, 25);
  417.                     this.Cap = this.TrackBarHandleRect.Contains(e.Location);
  418.                     base.Focus();
  419.                     bool jumpToMouse = this._JumpToMouse;
  420.                     if (jumpToMouse)
  421.                     {
  422.                         this.Value = this._Minimum + (int)Math.Round(unchecked((double)checked(this._Maximum - this._Minimum) * ((double)e.X / (double)base.Width)));
  423.                     }
  424.                 }
  425.             }
  426.         }
  427.         protected override void OnMouseUp(MouseEventArgs e)
  428.         {
  429.             base.OnMouseUp(e);
  430.             this.Cap = false;
  431.         }
  432.         public ColdTrackBar()
  433.         {
  434.             this.ThumbSize = new Size(15, 15);
  435.             this._Minimum = 0;
  436.             this._Maximum = 10;
  437.             this._Value = 0;
  438.             this._DrawValueString = false;
  439.             this._JumpToMouse = false;
  440.             this.DividedValue = ColdTrackBar.ValueDivisor.By1;
  441.             base.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer, true);
  442.             base.Size = new Size(80, 22);
  443.             this.MinimumSize = new Size(47, 22);
  444.         }
  445.         protected override void OnResize(EventArgs e)
  446.         {
  447.             base.OnResize(e);
  448.             bool drawValueString = this._DrawValueString;
  449.             if (drawValueString)
  450.             {
  451.                 base.Height = 35;
  452.             }
  453.             else
  454.             {
  455.                 base.Height = 22;
  456.             }
  457.         }
  458.         protected override void OnPaint(PaintEventArgs e)
  459.         {
  460.             base.OnPaint(e);
  461.             Graphics graphics = e.Graphics;
  462.             graphics.Clear(Color.FromArgb(218, 218, 218));
  463.             graphics.SmoothingMode = SmoothingMode.AntiAlias;
  464.             checked
  465.             {
  466.                 this.TrackThumb = new Rectangle(8, 8, base.Width - 11, 2);
  467.                 this.PipeBorder = RoundRectangle.RoundRect(1, 8, base.Width - 3, 1, 1);
  468.                 try
  469.                 {
  470.                     this.ValueDrawer = (int)Math.Round(unchecked(checked((double)(this._Value - this._Minimum) / (double)(this._Maximum - this._Minimum)) * (double)checked(base.Width - 11)));
  471.                 }
  472.                 catch (Exception expr_98)
  473.                 {
  474.                     ProjectData.SetProjectError(expr_98);
  475.                     ProjectData.ClearProjectError();
  476.                 }
  477.                 this.TrackBarHandleRect = new Rectangle(this.ValueDrawer, 0, 10, 20);
  478.                 graphics.SetClip(this.PipeBorder);
  479.                 graphics.FillPath(new SolidBrush(Color.FromArgb(221, 221, 221)), this.PipeBorder);
  480.                 this.FillValue = RoundRectangle.RoundRect(0, 8, this.TrackBarHandleRect.X + this.TrackBarHandleRect.Width - 3, 2, 1);
  481.                 graphics.ResetClip();
  482.                 graphics.SmoothingMode = SmoothingMode.HighQuality;
  483.                 graphics.DrawPath(new Pen(Color.FromArgb(0, 0, 0)), this.PipeBorder);
  484.                 graphics.DrawRectangle(Pens.Black, this.TrackThumb.X + (int)Math.Round(unchecked((double)this.TrackThumb.Width * ((double)this.Value / (double)this.Maximum))) - (int)Math.Round((double)this.ThumbSize.Width / 2.0), this.TrackThumb.Y + (int)Math.Round((double)this.TrackThumb.Height / 2.0) - (int)Math.Round((double)this.ThumbSize.Height / 2.0), this.ThumbSize.Width - 6, this.ThumbSize.Height);
  485.                 graphics.FillRectangle(Functions.DrawGradient(this.ThumbSize.Width, this.ThumbSize.Height, MouseState.None), this.TrackThumb.X + (int)Math.Round(unchecked((double)this.TrackThumb.Width * ((double)this.Value / (double)this.Maximum))) - (int)Math.Round((double)this.ThumbSize.Width / 2.0), this.TrackThumb.Y + (int)Math.Round((double)this.TrackThumb.Height / 2.0) - (int)Math.Round((double)this.ThumbSize.Height / 2.0), this.ThumbSize.Width - 6, this.ThumbSize.Height);
  486.                 bool drawValueString = this._DrawValueString;
  487.                 if (drawValueString)
  488.                 {
  489.                     graphics.DrawString(Conversions.ToString(this.ValueToSet), this.Font, Brushes.DimGray, 1f, 20f);
  490.                 }
  491.             }
  492.         }
  493.     }
  494.     internal class ColdListBox : ListBox
  495.     {
  496.         private Font mFont;
  497.         public GraphicsPath RoundRect(Rectangle rectangle, int curve)
  498.         {
  499.             GraphicsPath graphicsPath = new GraphicsPath();
  500.             checked
  501.             {
  502.                 int num = curve * 1;
  503.                 graphicsPath.AddArc(new Rectangle(rectangle.X, rectangle.Y, num, num), -180f, 90f);
  504.                 graphicsPath.AddArc(new Rectangle(rectangle.Width - num + rectangle.X, rectangle.Y, num, num), -90f, 90f);
  505.                 graphicsPath.AddArc(new Rectangle(rectangle.Width - num + rectangle.X, rectangle.Height - num + rectangle.Y, num, num), 0f, 90f);
  506.                 graphicsPath.AddArc(new Rectangle(rectangle.X, rectangle.Height - num + rectangle.Y, num, num), 90f, 90f);
  507.                 graphicsPath.AddLine(new Point(rectangle.X, rectangle.Height - num + rectangle.Y), new Point(rectangle.X, curve + rectangle.Y));
  508.                 return graphicsPath;
  509.             }
  510.         }
  511.         public GraphicsPath RoundRect(int x, int y, int width, int height, int curve)
  512.         {
  513.             Rectangle rectangle = new Rectangle(x, y, width, height);
  514.             GraphicsPath graphicsPath = new GraphicsPath();
  515.             checked
  516.             {
  517.                 int num = curve * 1;
  518.                 graphicsPath.AddArc(new Rectangle(rectangle.X, rectangle.Y, num, num), -180f, 90f);
  519.                 graphicsPath.AddArc(new Rectangle(rectangle.Width - num + rectangle.X, rectangle.Y, num, num), -90f, 90f);
  520.                 graphicsPath.AddArc(new Rectangle(rectangle.Width - num + rectangle.X, rectangle.Height - num + rectangle.Y, num, num), 0f, 90f);
  521.                 graphicsPath.AddArc(new Rectangle(rectangle.X, rectangle.Height - num + rectangle.Y, num, num), 90f, 90f);
  522.                 graphicsPath.AddLine(new Point(rectangle.X, rectangle.Height - num + rectangle.Y), new Point(rectangle.X, curve + rectangle.Y));
  523.                 return graphicsPath;
  524.             }
  525.         }
  526.         protected override void OnCreateControl()
  527.         {
  528.             this.Dock = DockStyle.None;
  529.             base.Invalidate();
  530.         }
  531.         public ColdListBox()
  532.         {
  533.             this.mFont = new Font("Segoe UI", 8f);
  534.             base.SetStyle(ControlStyles.SupportsTransparentBackColor | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
  535.             this.DoubleBuffered = true;
  536.             this.DrawMode = DrawMode.OwnerDrawFixed;
  537.             this.BackColor = Color.FromArgb(246, 246, 246);
  538.             base.Width = 200;
  539.             base.Height = 200;
  540.             this.Font = this.mFont;
  541.             this.ForeColor = Color.Black;
  542.             this.ItemHeight = 20;
  543.             base.BorderStyle = BorderStyle.FixedSingle;
  544.             base.ScrollAlwaysVisible = false;
  545.             base.HorizontalScrollbar = false;
  546.             base.IntegralHeight = false;
  547.         }
  548.         protected override void OnPaint(PaintEventArgs e)
  549.         {
  550.             checked
  551.             {
  552.                 using (Graphics graphics = e.Graphics)
  553.                 {
  554.                     graphics.SmoothingMode = SmoothingMode.HighQuality;
  555.                     graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;
  556.                     graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
  557.                     graphics.Clear(Color.FromArgb(246, 246, 246));
  558.                     graphics.DrawLine(Pens.Black, new Point(0, 0), new Point(base.Width, 0));
  559.                     graphics.DrawLine(Pens.Black, new Point(0, base.Height), new Point(0, 0));
  560.                     graphics.DrawLine(Pens.Black, new Point(base.Width + 1, 0), new Point(base.Width + 1, base.Height));
  561.                     graphics.DrawLine(Pens.Black, new Point(0, base.Height + 1), new Point(base.Width, base.Height + 1));
  562.                     graphics.Dispose();
  563.                 }
  564.                 base.OnPaint(e);
  565.                 e.Dispose();
  566.                 e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
  567.             }
  568.         }
  569.         protected override void OnDrawItem(DrawItemEventArgs e)
  570.         {
  571.             checked
  572.             {
  573.                 using (Graphics graphics = e.Graphics)
  574.                 {
  575.                     e.DrawBackground();
  576.                     e.DrawFocusRectangle();
  577.                     graphics.SmoothingMode = SmoothingMode.HighQuality;
  578.                     graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;
  579.                     graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
  580.                     graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
  581.                     graphics.FillRectangle(new SolidBrush(this.BackColor), new Rectangle(e.Bounds.X, e.Bounds.Y - 1, e.Bounds.Width, e.Bounds.Height + 3));
  582.                     bool flag = e.State.ToString().Contains("Selected,");
  583.                     if (flag)
  584.                     {
  585.                         SolidBrush brush = new SolidBrush(Color.FromArgb(217, 219, 218));
  586.                         graphics.FillRectangle(brush, new Rectangle(e.Bounds.X, e.Bounds.Y + 1, e.Bounds.Width, e.Bounds.Height));
  587.                         graphics.DrawRectangle(new Pen(Color.FromArgb(212, 212, 212)), new Rectangle(e.Bounds.X, e.Bounds.Y + 1, e.Bounds.Width, e.Bounds.Height));
  588.                     }
  589.                     else
  590.                     {
  591.                         SolidBrush brush2 = new SolidBrush(Color.FromArgb(246, 246, 246));
  592.                         graphics.FillRectangle(brush2, e.Bounds);
  593.                     }
  594.                     try
  595.                     {
  596.                         graphics.DrawString(base.Items[e.Index].ToString(), this.mFont, new SolidBrush(Color.FromArgb(0, 0, 0)), new Rectangle(e.Bounds.X + 3, e.Bounds.Y + 5, e.Bounds.Width, e.Bounds.Height), new StringFormat
  597.                         {
  598.                             LineAlignment = StringAlignment.Near,
  599.                             Alignment = StringAlignment.Near,
  600.                             FormatFlags = StringFormatFlags.FitBlackBox
  601.                         });
  602.                     }
  603.                     catch (Exception arg_237_0)
  604.                     {
  605.                         ProjectData.SetProjectError(arg_237_0);
  606.                         ProjectData.ClearProjectError();
  607.                     }
  608.                     graphics.Dispose();
  609.                 }
  610.             }
  611.         }
  612.     }
  613.     internal class ColdButton : Control
  614.     {
  615.         private bool Down;
  616.         private int MoveHeight;
  617.         private Point MousePoint;
  618.         private Font mFont;
  619.         private bool isMouseEnter;
  620.         private bool isMousePress;
  621.         protected override void OnMouseDown(MouseEventArgs e)
  622.         {
  623.             this.isMousePress = true;
  624.             this.Refresh();
  625.         }
  626.         protected override void OnMouseUp(MouseEventArgs e)
  627.         {
  628.             this.isMousePress = false;
  629.             this.Refresh();
  630.         }
  631.         protected override void OnCreateControl()
  632.         {
  633.             this.Dock = DockStyle.None;
  634.             base.Invalidate();
  635.         }
  636.         public ColdButton()
  637.         {
  638.             this.Down = false;
  639.             this.MoveHeight = 30;
  640.             this.MousePoint = new Point(0, 0);
  641.             this.mFont = new Font("Segoe UI", 10f);
  642.             this.isMouseEnter = false;
  643.             this.isMousePress = false;
  644.             this.BackColor = Color.FromArgb(51, 51, 51);
  645.             base.Width = 100;
  646.             base.Height = 30;
  647.             this.Font = this.mFont;
  648.         }
  649.         protected override void OnPaint(PaintEventArgs e)
  650.         {
  651.             checked
  652.             {
  653.                 using (Graphics graphics = e.Graphics)
  654.                 {
  655.                     graphics.Clear(Color.White);
  656.                     bool flag = !this.isMouseEnter & !this.isMousePress;
  657.                     if (flag)
  658.                     {
  659.                         graphics.FillRectangle(Functions.DrawGradient(base.Height, base.Width, MouseState.None), new Rectangle(new Point(0, 0), new Size(base.Width, base.Height)));
  660.                     }
  661.                     else
  662.                     {
  663.                         bool flag2 = this.isMousePress;
  664.                         if (flag2)
  665.                         {
  666.                             graphics.FillRectangle(Functions.DrawGradient(base.Height, base.Width, MouseState.Down), new Rectangle(new Point(0, 0), new Size(base.Width, base.Height)));
  667.                         }
  668.                         else
  669.                         {
  670.                             graphics.FillRectangle(Functions.DrawGradient(base.Height, base.Width, MouseState.Hover), new Rectangle(new Point(0, 0), new Size(base.Width, base.Height)));
  671.                         }
  672.                     }
  673.                     graphics.DrawLine(Pens.Black, new Point(0, 0), new Point(base.Width, 0));
  674.                     graphics.DrawLine(Pens.Black, new Point(0, base.Height), new Point(0, 0));
  675.                     graphics.DrawLine(Pens.Black, new Point(base.Width - 1, 0), new Point(base.Width - 1, base.Height));
  676.                     graphics.DrawLine(Pens.Black, new Point(0, base.Height - 1), new Point(base.Width, base.Height - 1));
  677.                     graphics.DrawString(this.Text, this.Font, Brushes.Black, new Point((Size)Functions.CenterText(this.Text, this.Font, base.Width, base.Height)));
  678.                 }
  679.             }
  680.         }
  681.         protected override void OnMouseEnter(EventArgs e)
  682.         {
  683.             this.isMouseEnter = true;
  684.             base.OnMouseEnter(e);
  685.             this.Refresh();
  686.         }
  687.         protected override void OnMouseLeave(EventArgs e)
  688.         {
  689.             this.isMouseEnter = false;
  690.             this.isMousePress = false;
  691.             base.OnMouseEnter(e);
  692.             this.Refresh();
  693.         }
  694.         protected override void OnSizeChanged(EventArgs e)
  695.         {
  696.             base.OnSizeChanged(e);
  697.             base.Refresh();
  698.         }
  699.     }
  700.     internal class ColdTabControl : TabControl
  701.     {
  702.         public ColdTabControl()
  703.         {
  704.             base.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer, true);
  705.             base.ItemSize = new Size(0, 30);
  706.             this.Font = new Font("Segoe UI", 8f);
  707.         }
  708.         protected override void CreateHandle()
  709.         {
  710.             base.CreateHandle();
  711.             base.Alignment = TabAlignment.Top;
  712.         }
  713.         protected override void OnPaint(PaintEventArgs e)
  714.         {
  715.             Graphics graphics = e.Graphics;
  716.             Pen pen = new Pen(Color.FromArgb(0, 0, 0));
  717.             graphics.SmoothingMode = SmoothingMode.HighQuality;
  718.             graphics.Clear(Color.FromArgb(218, 218, 218));
  719.             checked
  720.             {
  721.                 Rectangle rect = new Rectangle(2, base.ItemSize.Height + 2, base.Width - 6, base.Height - base.ItemSize.Height - 3);
  722.                 graphics.FillRectangle(new SolidBrush(Color.FromArgb(218, 218, 218)), rect);
  723.                 graphics.DrawRectangle(pen, rect);
  724.                 Color color = default(Color);
  725.                 int num = base.TabCount - 1;
  726.                 for (int i = 0; i <= num; i++)
  727.                 {
  728.                     Rectangle tabRect = base.GetTabRect(i);
  729.                     tabRect.Height -= 6;
  730.                     tabRect.Width -= 5;
  731.                     bool flag = i == base.SelectedIndex;
  732.                     if (flag)
  733.                     {
  734.                         graphics.FillRectangle(Functions.DrawGradient(tabRect.Height + 5, 0, MouseState.None), tabRect);
  735.                         graphics.DrawRectangle(pen, tabRect);
  736.                         color = Color.FromArgb(0, 0, 0);
  737.                     }
  738.                     else
  739.                     {
  740.                         graphics.FillRectangle(new SolidBrush(Color.FromArgb(218, 218, 218)), tabRect);
  741.                         graphics.DrawRectangle(pen, tabRect);
  742.                         color = Color.FromArgb(0, 0, 0);
  743.                     }
  744.                     int x = (int)Math.Round(unchecked((double)tabRect.Location.X + (double)tabRect.Width / 2.0 - (double)(graphics.MeasureString(base.TabPages[i].Text, this.Font).Width / 2f)));
  745.                     int y = (int)Math.Round(unchecked((double)tabRect.Location.Y + (double)tabRect.Height / 2.0 - (double)(graphics.MeasureString(base.TabPages[i].Text, this.Font).Height / 2f)));
  746.                     graphics.DrawString(base.TabPages[i].Text, this.Font, new SolidBrush(color), new Point(x, y));
  747.                     try
  748.                     {
  749.                         base.TabPages[i].BackColor = Color.FromArgb(218, 218, 218);
  750.                     }
  751.                     catch (Exception arg_26B_0)
  752.                     {
  753.                         ProjectData.SetProjectError(arg_26B_0);
  754.                         ProjectData.ClearProjectError();
  755.                     }
  756.                 }
  757.             }
  758.         }
  759.     }
  760.     [DefaultEvent("CheckedChanged")]
  761.     internal class ColdCheckBox : Control
  762.     {
  763.         public delegate void CheckedChangedEventHandler(object sender);
  764.         [DebuggerBrowsable(DebuggerBrowsableState.Never), CompilerGenerated]
  765.         private ColdCheckBox.CheckedChangedEventHandler CheckedChangedEvent;
  766.         private bool _checked;
  767.         public event ColdCheckBox.CheckedChangedEventHandler CheckedChanged
  768.         {
  769.             [CompilerGenerated]
  770.             add
  771.             {
  772.                 ColdCheckBox.CheckedChangedEventHandler checkedChangedEventHandler = this.CheckedChangedEvent;
  773.                 ColdCheckBox.CheckedChangedEventHandler checkedChangedEventHandler2;
  774.                 do
  775.                 {
  776.                     checkedChangedEventHandler2 = checkedChangedEventHandler;
  777.                     ColdCheckBox.CheckedChangedEventHandler value2 = (ColdCheckBox.CheckedChangedEventHandler)Delegate.Combine(checkedChangedEventHandler2, value);
  778.                     checkedChangedEventHandler = Interlocked.CompareExchange<ColdCheckBox.CheckedChangedEventHandler>(ref this.CheckedChangedEvent, value2, checkedChangedEventHandler2);
  779.                 }
  780.                 while (checkedChangedEventHandler != checkedChangedEventHandler2);
  781.             }
  782.             [CompilerGenerated]
  783.             remove
  784.             {
  785.                 ColdCheckBox.CheckedChangedEventHandler checkedChangedEventHandler = this.CheckedChangedEvent;
  786.                 ColdCheckBox.CheckedChangedEventHandler checkedChangedEventHandler2;
  787.                 do
  788.                 {
  789.                     checkedChangedEventHandler2 = checkedChangedEventHandler;
  790.                     ColdCheckBox.CheckedChangedEventHandler value2 = (ColdCheckBox.CheckedChangedEventHandler)Delegate.Remove(checkedChangedEventHandler2, value);
  791.                     checkedChangedEventHandler = Interlocked.CompareExchange<ColdCheckBox.CheckedChangedEventHandler>(ref this.CheckedChangedEvent, value2, checkedChangedEventHandler2);
  792.                 }
  793.                 while (checkedChangedEventHandler != checkedChangedEventHandler2);
  794.             }
  795.         }
  796.         public bool Checked
  797.         {
  798.             get
  799.             {
  800.                 return this._checked;
  801.             }
  802.             set
  803.             {
  804.                 this._checked = value;
  805.                 base.Invalidate();
  806.             }
  807.         }
  808.         public ColdCheckBox()
  809.         {
  810.             base.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
  811.             base.Size = new Size(140, 20);
  812.             this.Font = new Font("Segoe UI", 8f);
  813.         }
  814.         protected override void OnPaint(PaintEventArgs e)
  815.         {
  816.             Graphics graphics = e.Graphics;
  817.             graphics.SmoothingMode = SmoothingMode.HighQuality;
  818.             graphics.Clear(base.Parent.BackColor);
  819.             checked
  820.             {
  821.                 Rectangle rect = new Rectangle(0, 0, base.Height, base.Height - 1);
  822.                 graphics.FillRectangle(Functions.DrawGradient(rect.Height + 5, 0, MouseState.None), rect);
  823.                 graphics.DrawRectangle(new Pen(Color.FromArgb(218, 218, 218)), rect);
  824.                 rect.Width = 15;
  825.                 rect.Height = 15;
  826.                 graphics.DrawLine(Pens.Black, new Point(0, 0), new Point(rect.Width, 0));
  827.                 graphics.DrawLine(Pens.Black, new Point(0, 0), new Point(0, rect.Height));
  828.                 graphics.DrawLine(Pens.Black, new Point(rect.Width, 0), new Point(rect.Width, rect.Height));
  829.                 graphics.DrawLine(Pens.Black, new Point(0, rect.Height), new Point(rect.Width, rect.Height));
  830.                 Pen pen = new Pen(Color.FromArgb(218, 218, 218));
  831.                 Pen pen2 = new Pen(Color.FromArgb(0, 0, 0));
  832.                 bool @checked = this._checked;
  833.                 if (@checked)
  834.                 {
  835.                     graphics.DrawString("a", new Font("Marlett", 13f), Brushes.Black, new Point(-3, -1));
  836.                 }
  837.                 int num = (int)Math.Round(unchecked((double)base.Height / 2.0 - (double)(graphics.MeasureString(this.Text, this.Font).Height / 2f)));
  838.                 graphics.DrawString(this.Text, this.Font, Brushes.Black, new Point(24, num + 1));
  839.                 base.Size = new Size((int)Math.Round((double)unchecked(28f + graphics.MeasureString(this.Text, this.Font).Width)), 16);
  840.             }
  841.         }
  842.         protected override void OnMouseDown(MouseEventArgs e)
  843.         {
  844.             base.OnMouseDown(e);
  845.             bool flag = e.Button == MouseButtons.Left;
  846.             if (flag)
  847.             {
  848.                 bool @checked = this._checked;
  849.                 if (@checked)
  850.                 {
  851.                     this._checked = false;
  852.                 }
  853.                 else
  854.                 {
  855.                     this._checked = true;
  856.                 }
  857.                 ColdCheckBox.CheckedChangedEventHandler checkedChangedEvent = this.CheckedChangedEvent;
  858.                 if (checkedChangedEvent != null)
  859.                 {
  860.                     checkedChangedEvent(this);
  861.                 }
  862.                 base.Invalidate();
  863.             }
  864.         }
  865.     }
  866.     internal class ColdComboBox : ComboBox
  867.     {
  868.         public ColdComboBox()
  869.         {
  870.             base.DrawItem += new DrawItemEventHandler(this.replaceItem);
  871.             base.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
  872.             this.Font = new Font("Segoe UI", 7f);
  873.         }
  874.         protected override void CreateHandle()
  875.         {
  876.             base.CreateHandle();
  877.             base.DrawMode = DrawMode.OwnerDrawFixed;
  878.             base.DropDownStyle = ComboBoxStyle.DropDownList;
  879.             this.DoubleBuffered = true;
  880.             base.ItemHeight = 20;
  881.         }
  882.         protected override void OnPaint(PaintEventArgs e)
  883.         {
  884.             base.OnPaint(e);
  885.             Graphics graphics = e.Graphics;
  886.             graphics.SmoothingMode = SmoothingMode.HighQuality;
  887.             graphics.Clear(base.Parent.BackColor);
  888.             checked
  889.             {
  890.                 Rectangle rect = new Rectangle(0, 0, base.Width - 1, base.Height - 1);
  891.                 graphics.FillRectangle(new SolidBrush(Color.FromArgb(246, 246, 246)), rect);
  892.                 graphics.DrawRectangle(new Pen(Color.FromArgb(246, 246, 246)), rect);
  893.                 Point[] points = new Point[]
  894.                 {
  895.                    new Point(base.Width - 14, 16),
  896.                    new Point(base.Width - 18, 10),
  897.                    new Point(base.Width - 10, 10)
  898.                 };
  899.                 graphics.FillPolygon(Brushes.Black, points);
  900.                 graphics.DrawLine(Pens.Black, new Point(0, 0), new Point(base.Width, 0));
  901.                 graphics.DrawLine(Pens.Black, new Point(0, 0), new Point(0, base.Height));
  902.                 graphics.DrawLine(Pens.Black, new Point(base.Width - 25, 0), new Point(base.Width - 25, base.Height));
  903.                 graphics.DrawLine(Pens.Black, new Point(base.Width - 1, 0), new Point(base.Width - 1, base.Height));
  904.                 graphics.DrawLine(Pens.Black, new Point(0, base.Height - 1), new Point(base.Width, base.Height - 1));
  905.                 try
  906.                 {
  907.                     bool flag = base.Items.Count > 0;
  908.                     if (flag)
  909.                     {
  910.                         bool flag2 = this.SelectedIndex != -1;
  911.                         if (flag2)
  912.                         {
  913.                             int x = 6;
  914.                             int y = (int)Math.Round(unchecked((double)checked(base.Height - 1) / 2.0 - (double)(graphics.MeasureString(Conversions.ToString(base.Items[this.SelectedIndex]), this.Font).Height / 2f) + 1.0));
  915.                             graphics.DrawString(Conversions.ToString(base.Items[this.SelectedIndex]), this.Font, Brushes.Black, new Point(x, y));
  916.                         }
  917.                         else
  918.                         {
  919.                             int x2 = 6;
  920.                             int y2 = (int)Math.Round(unchecked((double)checked(base.Height - 1) / 2.0 - (double)(graphics.MeasureString(Conversions.ToString(base.Items[0]), this.Font).Height / 2f) + 1.0));
  921.                             graphics.DrawString(Conversions.ToString(base.Items[0]), this.Font, Brushes.Black, new Point(x2, y2));
  922.                         }
  923.                     }
  924.                 }
  925.                 catch (Exception arg_2F4_0)
  926.                 {
  927.                     ProjectData.SetProjectError(arg_2F4_0);
  928.                     ProjectData.ClearProjectError();
  929.                 }
  930.             }
  931.         }
  932.         public void replaceItem(object sender, DrawItemEventArgs e)
  933.         {
  934.             e.DrawBackground();
  935.             Graphics graphics = e.Graphics;
  936.             graphics.SmoothingMode = SmoothingMode.HighQuality;
  937.             checked
  938.             {
  939.                 Rectangle rect = new Rectangle(e.Bounds.X - 1, e.Bounds.Y - 1, e.Bounds.Width + 1, e.Bounds.Height + 1);
  940.                 try
  941.                 {
  942.                     bool flag = (e.State & DrawItemState.Selected) == DrawItemState.Selected;
  943.                     if (flag)
  944.                     {
  945.                         graphics.FillRectangle(new SolidBrush(Color.FromArgb(245, 246, 246, 246)), rect);
  946.                         graphics.DrawString(base.GetItemText(RuntimeHelpers.GetObjectValue(base.Items[e.Index])), this.Font, Brushes.Black, new Rectangle(e.Bounds.X + 6, e.Bounds.Y + 3, e.Bounds.Width, e.Bounds.Height));
  947.                         graphics.DrawRectangle(new Pen(Color.FromArgb(20, 160, 230)), rect);
  948.                     }
  949.                     else
  950.                     {
  951.                         graphics.FillRectangle(new SolidBrush(Color.FromArgb(246, 246, 246)), rect);
  952.                         graphics.DrawString(base.GetItemText(RuntimeHelpers.GetObjectValue(base.Items[e.Index])), this.Font, Brushes.Black, new Rectangle(e.Bounds.X + 6, e.Bounds.Y + 3, e.Bounds.Width, e.Bounds.Height));
  953.                         graphics.DrawRectangle(new Pen(Color.FromArgb(246, 246, 246)), rect);
  954.                     }
  955.                 }
  956.                 catch (Exception arg_1E9_0)
  957.                 {
  958.                     ProjectData.SetProjectError(arg_1E9_0);
  959.                     ProjectData.ClearProjectError();
  960.                 }
  961.             }
  962.         }
  963.         protected override void OnSelectedItemChanged(EventArgs e)
  964.         {
  965.             base.OnSelectedItemChanged(e);
  966.             base.Invalidate();
  967.         }
  968.     }
  969.     [DefaultEvent("CheckedChanged")]
  970.     internal class ColdRadioButton : Control
  971.     {
  972.         public delegate void CheckedChangedEventHandler(object sender);
  973.         [DebuggerBrowsable(DebuggerBrowsableState.Never), CompilerGenerated]
  974.         private ColdRadioButton.CheckedChangedEventHandler CheckedChangedEvent;
  975.         private bool _checked;
  976.         public event ColdRadioButton.CheckedChangedEventHandler CheckedChanged
  977.         {
  978.             [CompilerGenerated]
  979.             add
  980.             {
  981.                 ColdRadioButton.CheckedChangedEventHandler checkedChangedEventHandler = this.CheckedChangedEvent;
  982.                 ColdRadioButton.CheckedChangedEventHandler checkedChangedEventHandler2;
  983.                 do
  984.                 {
  985.                     checkedChangedEventHandler2 = checkedChangedEventHandler;
  986.                     ColdRadioButton.CheckedChangedEventHandler value2 = (ColdRadioButton.CheckedChangedEventHandler)Delegate.Combine(checkedChangedEventHandler2, value);
  987.                     checkedChangedEventHandler = Interlocked.CompareExchange<ColdRadioButton.CheckedChangedEventHandler>(ref this.CheckedChangedEvent, value2, checkedChangedEventHandler2);
  988.                 }
  989.                 while (checkedChangedEventHandler != checkedChangedEventHandler2);
  990.             }
  991.             [CompilerGenerated]
  992.             remove
  993.             {
  994.                 ColdRadioButton.CheckedChangedEventHandler checkedChangedEventHandler = this.CheckedChangedEvent;
  995.                 ColdRadioButton.CheckedChangedEventHandler checkedChangedEventHandler2;
  996.                 do
  997.                 {
  998.                     checkedChangedEventHandler2 = checkedChangedEventHandler;
  999.                     ColdRadioButton.CheckedChangedEventHandler value2 = (ColdRadioButton.CheckedChangedEventHandler)Delegate.Remove(checkedChangedEventHandler2, value);
  1000.                     checkedChangedEventHandler = Interlocked.CompareExchange<ColdRadioButton.CheckedChangedEventHandler>(ref this.CheckedChangedEvent, value2, checkedChangedEventHandler2);
  1001.                 }
  1002.                 while (checkedChangedEventHandler != checkedChangedEventHandler2);
  1003.             }
  1004.         }
  1005.         public bool Checked
  1006.         {
  1007.             get
  1008.             {
  1009.                 return this._checked;
  1010.             }
  1011.             set
  1012.             {
  1013.                 this._checked = value;
  1014.                 base.Invalidate();
  1015.             }
  1016.         }
  1017.         public ColdRadioButton()
  1018.         {
  1019.             base.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
  1020.             base.Size = new Size(140, 20);
  1021.             this.Font = new Font("Segoe UI", 8f);
  1022.         }
  1023.         protected override void OnPaint(PaintEventArgs e)
  1024.         {
  1025.             Graphics graphics = e.Graphics;
  1026.             graphics.SmoothingMode = SmoothingMode.HighQuality;
  1027.             graphics.Clear(base.Parent.BackColor);
  1028.             checked
  1029.             {
  1030.                 Rectangle rect = new Rectangle(0, 0, base.Height - 5, base.Height - 5);
  1031.                 graphics.FillEllipse(new SolidBrush(Color.FromArgb(235, 235, 235)), rect);
  1032.                 graphics.DrawEllipse(new Pen(Color.FromArgb(0, 0, 0)), rect);
  1033.                 bool @checked = this._checked;
  1034.                 if (@checked)
  1035.                 {
  1036.                     Rectangle rect2 = new Rectangle(1, 1, base.Height - 7, base.Height - 7);
  1037.                     graphics.FillEllipse(Functions.DrawGradient(20, 5, MouseState.None), rect2);
  1038.                 }
  1039.                 int num = (int)Math.Round(unchecked((double)base.Height / 2.0 - (double)(graphics.MeasureString(this.Text, this.Font).Height / 2f)));
  1040.                 graphics.DrawString(this.Text, this.Font, Brushes.Black, new Point(20, num - 1));
  1041.                 base.Size = new Size((int)Math.Round((double)unchecked(26f + graphics.MeasureString(this.Text, this.Font).Width)), 18);
  1042.             }
  1043.         }
  1044.         protected override void OnMouseDown(MouseEventArgs e)
  1045.         {
  1046.             base.OnMouseDown(e);
  1047.             bool flag = e.Button == MouseButtons.Left;
  1048.             if (flag)
  1049.             {
  1050.                 try
  1051.                 {
  1052.                     IEnumerator enumerator = base.Parent.Controls.GetEnumerator();
  1053.                     while (enumerator.MoveNext())
  1054.                     {
  1055.                         Control control = (Control)enumerator.Current;
  1056.                         bool flag2 = control != this && control is ColdRadioButton;
  1057.                         if (flag2)
  1058.                         {
  1059.                             ((ColdRadioButton)control).Checked = false;
  1060.                         }
  1061.                     }
  1062.                 }
  1063.                 finally
  1064.                 {
  1065.                     IEnumerator enumerator = null;
  1066.                     if (enumerator is IDisposable)
  1067.                     {
  1068.                         (enumerator as IDisposable).Dispose();
  1069.                     }
  1070.                 }
  1071.                 bool flag3 = !this._checked;
  1072.                 if (flag3)
  1073.                 {
  1074.                     this._checked = true;
  1075.                 }
  1076.                 ColdRadioButton.CheckedChangedEventHandler checkedChangedEvent = this.CheckedChangedEvent;
  1077.                 if (checkedChangedEvent != null)
  1078.                 {
  1079.                     checkedChangedEvent(this);
  1080.                 }
  1081.                 base.Invalidate();
  1082.             }
  1083.         }
  1084.     }
  1085.     internal class ColdGroupBox : GroupBox
  1086.     {
  1087.         public ColdGroupBox()
  1088.         {
  1089.             this.BackColor = Color.FromArgb(218, 218, 218);
  1090.         }
  1091.         protected override void OnPaint(PaintEventArgs e)
  1092.         {
  1093.             base.OnPaint(e);
  1094.             using (Graphics graphics = e.Graphics)
  1095.             {
  1096.                 graphics.Clear(Color.FromArgb(218, 218, 218));
  1097.                 graphics.DrawLine(Pens.Black, new Point(0, 0), new Point(0, 0));
  1098.                 Rectangle rect = new Rectangle(new Point(0, 0), checked(new Size(base.Width - 1, base.Height - 1)));
  1099.                 Rectangle rect2 = new Rectangle(new Point(0, 0), new Size(base.Width, 25));
  1100.                 graphics.FillRectangle(Functions.DrawGradient(40, 25, MouseState.None), rect2);
  1101.                 graphics.DrawRectangle(Pens.Black, rect);
  1102.                 graphics.DrawString(this.Text, this.Font, Brushes.Black, Functions.CenterText(this.Text, this.Font, base.Width, 25));
  1103.                 graphics.DrawLine(Pens.Black, new Point(0, 25), new Point(base.Width, 25));
  1104.             }
  1105.         }
  1106.     }
  1107.     internal class ColdLabel : Control
  1108.     {
  1109.         protected override void OnPaint(PaintEventArgs e)
  1110.         {
  1111.             base.OnPaint(e);
  1112.             checked
  1113.             {
  1114.                 using (Graphics graphics = e.Graphics)
  1115.                 {
  1116.                     graphics.Clear(Color.FromArgb(216, 216, 216));
  1117.                     graphics.DrawString(this.Text, this.Font, Brushes.Black, new Point(0, 0));
  1118.                     base.Height = (int)Math.Round((double)graphics.MeasureString(this.Text, this.Font, base.Width).Height);
  1119.                     base.Width = (int)Math.Round((double)graphics.MeasureString(this.Text, this.Font, base.Width).Width);
  1120.                 }
  1121.             }
  1122.         }
  1123.     }
  1124.     [DefaultEvent("TextChanged")]
  1125.     internal class ColdTextBox : TextBox
  1126.     {
  1127.         protected override void OnCreateControl()
  1128.         {
  1129.             base.OnCreateControl();
  1130.         }
  1131.         public ColdTextBox()
  1132.         {
  1133.             base.BorderStyle = BorderStyle.FixedSingle;
  1134.             this.BackColor = Color.FromArgb(216, 216, 216);
  1135.             base.Margin = new Padding(5, 0, 0, 0);
  1136.             this.Font = new Font("Segoe UI", 8f);
  1137.         }
  1138.         protected override void OnPaint(PaintEventArgs e)
  1139.         {
  1140.             checked
  1141.             {
  1142.                 using (Graphics graphics = e.Graphics)
  1143.                 {
  1144.                     graphics.DrawLine(Pens.Black, new Point(0, 0), new Point(base.Width, 0));
  1145.                     graphics.DrawLine(Pens.Black, new Point(0, base.Height), new Point(0, 0));
  1146.                     graphics.DrawLine(Pens.Black, new Point(base.Width - 1, 0), new Point(base.Width - 1, base.Height));
  1147.                     graphics.DrawLine(Pens.Black, new Point(0, base.Height - 1), new Point(base.Width, base.Height - 1));
  1148.                 }
  1149.                 base.OnPaint(e);
  1150.             }
  1151.         }
  1152.     }
  1153.     internal class ColdProgressBar : Control
  1154.     {
  1155.         private int _Maximum;
  1156.         private bool _ShowPercant;
  1157.         private int _Minimum;
  1158.         private int _Value;
  1159.         public bool ShowPercant
  1160.         {
  1161.             get
  1162.             {
  1163.                 return this._ShowPercant;
  1164.             }
  1165.             set
  1166.             {
  1167.                 this._ShowPercant = value;
  1168.                 base.Invalidate();
  1169.             }
  1170.         }
  1171.         public int Maximum
  1172.         {
  1173.             get
  1174.             {
  1175.                 return this._Maximum;
  1176.             }
  1177.             set
  1178.             {
  1179.                 bool flag = value < 1;
  1180.                 if (flag)
  1181.                 {
  1182.                     value = 1;
  1183.                 }
  1184.                 bool flag2 = value < this._Value;
  1185.                 if (flag2)
  1186.                 {
  1187.                     this._Value = value;
  1188.                 }
  1189.                 this._Maximum = value;
  1190.                 base.Invalidate();
  1191.             }
  1192.         }
  1193.         public int Minimum
  1194.         {
  1195.             get
  1196.             {
  1197.                 return this._Minimum;
  1198.             }
  1199.             set
  1200.             {
  1201.                 bool flag = value <= -1;
  1202.                 if (flag)
  1203.                 {
  1204.                     value = 0;
  1205.                 }
  1206.                 bool flag2 = value > this._Maximum;
  1207.                 if (flag2)
  1208.                 {
  1209.                     value = checked(this._Maximum - 1);
  1210.                 }
  1211.                 this._Minimum = value;
  1212.                 base.Invalidate();
  1213.             }
  1214.         }
  1215.         public int Value
  1216.         {
  1217.             get
  1218.             {
  1219.                 return this._Value;
  1220.             }
  1221.             set
  1222.             {
  1223.                 bool flag = value > this._Maximum;
  1224.                 if (flag)
  1225.                 {
  1226.                     value = this.Maximum;
  1227.                 }
  1228.                 this._Value = value;
  1229.                 base.Invalidate();
  1230.             }
  1231.         }
  1232.         public ColdProgressBar()
  1233.         {
  1234.             this._Maximum = 100;
  1235.             this._ShowPercant = true;
  1236.             this._Minimum = 0;
  1237.             base.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
  1238.             base.Size = new Size(100, 24);
  1239.             this.Maximum = 100;
  1240.             this.Minimum = 0;
  1241.             this.Text = "";
  1242.             this.Font = new Font("Segoe UI", 8f);
  1243.         }
  1244.         protected override void OnPaint(PaintEventArgs e)
  1245.         {
  1246.             base.OnPaint(e);
  1247.             string text = this.Text;
  1248.             this.Text = "";
  1249.             Graphics graphics = e.Graphics;
  1250.             graphics.SmoothingMode = SmoothingMode.HighQuality;
  1251.             graphics.Clear(base.Parent.BackColor);
  1252.             checked
  1253.             {
  1254.                 Rectangle rect = new Rectangle(0, 0, base.Width - 1, base.Height - 1);
  1255.                 graphics.FillRectangle(new SolidBrush(Color.FromArgb(235, 235, 235)), rect);
  1256.                 graphics.DrawRectangle(Pens.Black, rect);
  1257.                 Rectangle rect2 = new Rectangle(0, 0, (int)Math.Round(unchecked((double)base.Width / (double)this._Maximum * (double)this._Value - 1.0)), base.Height - 1);
  1258.                 graphics.FillRectangle(Functions.DrawGradient(base.Height, (int)Math.Round(unchecked((double)base.Width / (double)this._Maximum * (double)this._Value - 1.0)), MouseState.None), rect2);
  1259.                 float value = (float)unchecked((double)this._Value / (double)this._Maximum * 100.0);
  1260.                 string s = this.Text + " " + Conversions.ToString(value) + "%";
  1261.                 bool showPercant = this.ShowPercant;
  1262.                 if (showPercant)
  1263.                 {
  1264.                     graphics.DrawString(s, this.Font, Brushes.Black, Functions.LeftText(this.Text, this.Font, base.Width, (int)Math.Round(unchecked((double)base.Height / 2.0 - 1.0))));
  1265.                 }
  1266.                 else
  1267.                 {
  1268.                     graphics.DrawString(text, this.Font, Brushes.Black, Functions.CenterText(this.Text, this.Font, base.Width, (int)Math.Round(unchecked((double)base.Height / 2.0 - 3.0))));
  1269.                 }
  1270.                 this.Text = text;
  1271.             }
  1272.         }
  1273.     }
  1274.  
  1275.     class Class2
  1276.     {
  1277.     }
  1278. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement