Advertisement
illusion_reality

Velocity Theme C# - Converted By RaStA_ToXiC_91

Oct 11th, 2017
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 70.64 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.Drawing;
  7. using System.Drawing.Drawing2D;
  8. using System.Drawing.Text;
  9. using System.IO;
  10. using System.Runtime.CompilerServices;
  11. using System.Text;
  12. using System.Windows.Forms;
  13.  
  14. namespace Theme
  15. {
  16.     class VelocityTheme
  17.     {
  18.         public class VelocityToggle : Control
  19.         {
  20.  
  21.             private static void __ENCAddToList(object value)
  22.             {
  23.                 List<WeakReference> _ENCList = VelocityToggle.__ENCList;
  24.                 checked
  25.                 {
  26.                     lock (_ENCList)
  27.                     {
  28.                         bool flag = VelocityToggle.__ENCList.Count == VelocityToggle.__ENCList.Capacity;
  29.                         if (flag)
  30.                         {
  31.                             int num = 0;
  32.                             int arg_3F_0 = 0;
  33.                             int num2 = VelocityToggle.__ENCList.Count - 1;
  34.                             int num3 = arg_3F_0;
  35.                             while (true)
  36.                             {
  37.                                 int arg_90_0 = num3;
  38.                                 int num4 = num2;
  39.                                 if (arg_90_0 > num4)
  40.                                 {
  41.                                     break;
  42.                                 }
  43.                                 WeakReference weakReference = VelocityToggle.__ENCList[num3];
  44.                                 flag = weakReference.IsAlive;
  45.                                 if (flag)
  46.                                 {
  47.                                     bool flag2 = num3 != num;
  48.                                     if (flag2)
  49.                                     {
  50.                                         VelocityToggle.__ENCList[num] = VelocityToggle.__ENCList[num3];
  51.                                     }
  52.                                     num++;
  53.                                 }
  54.                                 num3++;
  55.                             }
  56.                             VelocityToggle.__ENCList.RemoveRange(num, VelocityToggle.__ENCList.Count - num);
  57.                             VelocityToggle.__ENCList.Capacity = VelocityToggle.__ENCList.Count;
  58.                         }
  59.                         VelocityToggle.__ENCList.Add(new WeakReference(RuntimeHelpers.GetObjectValue(value)));
  60.                     }
  61.                 }
  62.             }
  63.  
  64.             public bool Checked
  65.             {
  66.                 get
  67.                 {
  68.                     return this._checked;
  69.                 }
  70.                 set
  71.                 {
  72.                     this._checked = value;
  73.                     this.Invalidate();
  74.                 }
  75.             }
  76.  
  77.             public VelocityToggle()
  78.             {
  79.                 VelocityToggle.__ENCAddToList(this);
  80.                 this._checked = false;
  81.                 Size size = new Size(50, 23);
  82.                 this.Size = size;
  83.                 this.DoubleBuffered = true;
  84.             }
  85.  
  86.             protected override void OnPaint(PaintEventArgs e)
  87.             {
  88.                 base.OnPaint(e);
  89.                 Graphics g = e.Graphics;
  90.                 g.Clear(Helpers.FromHex("#435363"));
  91.                 checked
  92.                 {
  93.                     switch (this._checked)
  94.                     {
  95.                         case false:
  96.                             g.FillRectangle(new SolidBrush(Helpers.FromHex("#2c3e50")), 4, 4, 15, 15);
  97.                             break;
  98.                         case true:
  99.                             g.FillRectangle(Brushes.White, this.Width - 19, this.Height - 19, 15, 15);
  100.                             break;
  101.                     }
  102.                 }
  103.             }
  104.  
  105.             protected override void OnMouseDown(MouseEventArgs e)
  106.             {
  107.                 base.OnMouseDown(e);
  108.                 this._checked = !this._checked;
  109.                 this.Invalidate();
  110.             }
  111.  
  112.             private static List<WeakReference> __ENCList = new List<WeakReference>();
  113.  
  114.             private bool _checked;
  115.         }
  116.         public class VelocityTitle : Control
  117.         {
  118.             private static void __ENCAddToList(object value)
  119.             {
  120.                 List<WeakReference> _ENCList = VelocityTitle.__ENCList;
  121.                 checked
  122.                 {
  123.                     lock (_ENCList)
  124.                     {
  125.                         bool flag = VelocityTitle.__ENCList.Count == VelocityTitle.__ENCList.Capacity;
  126.                         if (flag)
  127.                         {
  128.                             int num = 0;
  129.                             int arg_3F_0 = 0;
  130.                             int num2 = VelocityTitle.__ENCList.Count - 1;
  131.                             int num3 = arg_3F_0;
  132.                             while (true)
  133.                             {
  134.                                 int arg_90_0 = num3;
  135.                                 int num4 = num2;
  136.                                 if (arg_90_0 > num4)
  137.                                 {
  138.                                     break;
  139.                                 }
  140.                                 WeakReference weakReference = VelocityTitle.__ENCList[num3];
  141.                                 flag = weakReference.IsAlive;
  142.                                 if (flag)
  143.                                 {
  144.                                     bool flag2 = num3 != num;
  145.                                     if (flag2)
  146.                                     {
  147.                                         VelocityTitle.__ENCList[num] = VelocityTitle.__ENCList[num3];
  148.                                     }
  149.                                     num++;
  150.                                 }
  151.                                 num3++;
  152.                             }
  153.                             VelocityTitle.__ENCList.RemoveRange(num, VelocityTitle.__ENCList.Count - num);
  154.                             VelocityTitle.__ENCList.Capacity = VelocityTitle.__ENCList.Count;
  155.                         }
  156.                         VelocityTitle.__ENCList.Add(new WeakReference(RuntimeHelpers.GetObjectValue(value)));
  157.                     }
  158.                 }
  159.             }
  160.  
  161.             public Helpers.TxtAlign TextAlign
  162.             {
  163.                 get
  164.                 {
  165.                     return this._txtAlign;
  166.                 }
  167.                 set
  168.                 {
  169.                     this._txtAlign = value;
  170.                     this.Invalidate();
  171.                 }
  172.             }
  173.  
  174.             public VelocityTitle()
  175.             {
  176.                 VelocityTitle.__ENCAddToList(this);
  177.                 this._txtAlign = Helpers.TxtAlign.Left;
  178.                 this.DoubleBuffered = true;
  179.                 Size size = new Size(180, 23);
  180.                 this.Size = size;
  181.             }
  182.  
  183.             protected override void OnPaint(PaintEventArgs e)
  184.             {
  185.                 base.OnPaint(e);
  186.                 Graphics g = e.Graphics;
  187.                 Graphics arg_67_0 = g;
  188.                 Pen arg_67_1 = new Pen(Helpers.FromHex("#435363"));
  189.                 checked
  190.                 {
  191.                     Point point = new Point(0, (int)Math.Round((double)this.Height / 2.0));
  192.                     Point arg_67_2 = point;
  193.                     Point pt = new Point(this.Width, (int)Math.Round((double)this.Height / 2.0));
  194.                     arg_67_0.DrawLine(arg_67_1, arg_67_2, pt);
  195.                     Size txtRect = new Size((Point)g.MeasureString(this.Text, this.Font).ToSize());
  196.                     switch (this._txtAlign)
  197.                     {
  198.                         case Helpers.TxtAlign.Left:
  199.                             {
  200.                                 Graphics arg_138_0 = g;
  201.                                 Brush arg_138_1 = new SolidBrush(this.BackColor);
  202.                                 Rectangle rect = new Rectangle(18, (int)Math.Round(unchecked((double)this.Height / 2.0 - (double)txtRect.Height - 2.0)), txtRect.Width + 6, (int)Math.Round(unchecked((double)this.Height / 2.0 + (double)txtRect.Height / 2.0 + 6.0)));
  203.                                 arg_138_0.FillRectangle(arg_138_1, rect);
  204.                                 g.DrawString(this.Text, this.Font, new SolidBrush(this.ForeColor), 20f, (float)(unchecked((double)this.Height / 2.0 - (double)txtRect.Height / 2.0)));
  205.                                 break;
  206.                             }
  207.                         case Helpers.TxtAlign.Center:
  208.                             {
  209.                                 Graphics arg_21C_0 = g;
  210.                                 Brush arg_21C_1 = new SolidBrush(this.BackColor);
  211.                                 Rectangle rect = new Rectangle((int)Math.Round(unchecked((double)this.Width / 2.0 - (double)txtRect.Width / 2.0 - 2.0)), (int)Math.Round(unchecked((double)this.Height / 2.0 - (double)txtRect.Height / 2.0 - 2.0)), txtRect.Width + 2, txtRect.Height + 2);
  212.                                 arg_21C_0.FillRectangle(arg_21C_1, rect);
  213.                                 unchecked
  214.                                 {
  215.                                     g.DrawString(this.Text, this.Font, new SolidBrush(this.ForeColor), (float)((double)this.Width / 2.0 - (double)txtRect.Width / 2.0), (float)((double)this.Height / 2.0 - (double)txtRect.Height / 2.0));
  216.                                     break;
  217.                                 }
  218.                             }
  219.                         case Helpers.TxtAlign.Right:
  220.                             {
  221.                                 Graphics arg_2F2_0 = g;
  222.                                 Brush arg_2F2_1 = new SolidBrush(this.BackColor);
  223.                                 Rectangle rect = new Rectangle(this.Width - (txtRect.Width + 18), (int)Math.Round(unchecked((double)this.Height / 2.0 - (double)txtRect.Height - 2.0)), txtRect.Width + 4, this.Height + 6);
  224.                                 arg_2F2_0.FillRectangle(arg_2F2_1, rect);
  225.                                 g.DrawString(this.Text, this.Font, new SolidBrush(this.ForeColor), (float)(this.Width - (txtRect.Width + 16)), (float)(unchecked((double)this.Height / 2.0 - (double)txtRect.Height / 2.0)));
  226.                                 break;
  227.                             }
  228.                     }
  229.                 }
  230.             }
  231.  
  232.             protected override void OnFontChanged(EventArgs e)
  233.             {
  234.                 base.OnFontChanged(e);
  235.                 this.Invalidate();
  236.             }
  237.  
  238.             protected override void OnTextChanged(EventArgs e)
  239.             {
  240.                 base.OnTextChanged(e);
  241.                 this.Invalidate();
  242.             }
  243.  
  244.             private static List<WeakReference> __ENCList = new List<WeakReference>();
  245.  
  246.             private Helpers.TxtAlign _txtAlign;
  247.         }
  248.         public class VelocityTag : Control
  249.         {
  250.             private static void __ENCAddToList(object value)
  251.             {
  252.                 List<WeakReference> _ENCList = VelocityTag.__ENCList;
  253.                 checked
  254.                 {
  255.                     lock (_ENCList)
  256.                     {
  257.                         bool flag = VelocityTag.__ENCList.Count == VelocityTag.__ENCList.Capacity;
  258.                         if (flag)
  259.                         {
  260.                             int num = 0;
  261.                             int arg_3F_0 = 0;
  262.                             int num2 = VelocityTag.__ENCList.Count - 1;
  263.                             int num3 = arg_3F_0;
  264.                             while (true)
  265.                             {
  266.                                 int arg_90_0 = num3;
  267.                                 int num4 = num2;
  268.                                 if (arg_90_0 > num4)
  269.                                 {
  270.                                     break;
  271.                                 }
  272.                                 WeakReference weakReference = VelocityTag.__ENCList[num3];
  273.                                 flag = weakReference.IsAlive;
  274.                                 if (flag)
  275.                                 {
  276.                                     bool flag2 = num3 != num;
  277.                                     if (flag2)
  278.                                     {
  279.                                         VelocityTag.__ENCList[num] = VelocityTag.__ENCList[num3];
  280.                                     }
  281.                                     num++;
  282.                                 }
  283.                                 num3++;
  284.                             }
  285.                             VelocityTag.__ENCList.RemoveRange(num, VelocityTag.__ENCList.Count - num);
  286.                             VelocityTag.__ENCList.Capacity = VelocityTag.__ENCList.Count;
  287.                         }
  288.                         VelocityTag.__ENCList.Add(new WeakReference(RuntimeHelpers.GetObjectValue(value)));
  289.                     }
  290.                 }
  291.             }
  292.  
  293.             public Color Border
  294.             {
  295.                 get
  296.                 {
  297.                     return this._border;
  298.                 }
  299.                 set
  300.                 {
  301.                     this._border = value;
  302.                     this.Invalidate();
  303.                 }
  304.             }
  305.  
  306.             public VelocityTag()
  307.             {
  308.                 VelocityTag.__ENCAddToList(this);
  309.                 this._border = Helpers.FromHex("#2c3e50");
  310.                 this.DoubleBuffered = true;
  311.                 this.BackColor = Helpers.FromHex("#34495e");
  312.                 this.ForeColor = Color.White;
  313.             }
  314.  
  315.             protected override void OnPaint(PaintEventArgs e)
  316.             {
  317.                 base.OnPaint(e);
  318.                 Graphics g = e.Graphics;
  319.                 g.Clear(this.BackColor);
  320.                 checked
  321.                 {
  322.                     g.DrawRectangle(new Pen(this._border), 0, 0, this.Width - 1, this.Height - 1);
  323.                     Graphics arg_8C_0 = g;
  324.                     string arg_8C_1 = this.Text;
  325.                     Font arg_8C_2 = this.Font;
  326.                     Brush arg_8C_3 = new SolidBrush(this.ForeColor);
  327.                     Rectangle r = new Rectangle(0, 0, this.Width, this.Height);
  328.                     arg_8C_0.DrawString(arg_8C_1, arg_8C_2, arg_8C_3, r, new StringFormat
  329.                     {
  330.                         Alignment = StringAlignment.Center,
  331.                         LineAlignment = StringAlignment.Center
  332.                     });
  333.                 }
  334.             }
  335.  
  336.             protected override void OnTextChanged(EventArgs e)
  337.             {
  338.                 base.OnTextChanged(e);
  339.                 this.Invalidate();
  340.             }
  341.  
  342.             private static List<WeakReference> __ENCList = new List<WeakReference>();
  343.  
  344.             private Color _border;
  345.         }
  346.         public class VelocityTabControl : TabControl
  347.         {
  348.  
  349.             private static void __ENCAddToList(object value)
  350.             {
  351.                 List<WeakReference> _ENCList = VelocityTabControl.__ENCList;
  352.                 checked
  353.                 {
  354.                     lock (_ENCList)
  355.                     {
  356.                         bool flag = VelocityTabControl.__ENCList.Count == VelocityTabControl.__ENCList.Capacity;
  357.                         if (flag)
  358.                         {
  359.                             int num = 0;
  360.                             int arg_3F_0 = 0;
  361.                             int num2 = VelocityTabControl.__ENCList.Count - 1;
  362.                             int num3 = arg_3F_0;
  363.                             while (true)
  364.                             {
  365.                                 int arg_90_0 = num3;
  366.                                 int num4 = num2;
  367.                                 if (arg_90_0 > num4)
  368.                                 {
  369.                                     break;
  370.                                 }
  371.                                 WeakReference weakReference = VelocityTabControl.__ENCList[num3];
  372.                                 flag = weakReference.IsAlive;
  373.                                 if (flag)
  374.                                 {
  375.                                     bool flag2 = num3 != num;
  376.                                     if (flag2)
  377.                                     {
  378.                                         VelocityTabControl.__ENCList[num] = VelocityTabControl.__ENCList[num3];
  379.                                     }
  380.                                     num++;
  381.                                 }
  382.                                 num3++;
  383.                             }
  384.                             VelocityTabControl.__ENCList.RemoveRange(num, VelocityTabControl.__ENCList.Count - num);
  385.                             VelocityTabControl.__ENCList.Capacity = VelocityTabControl.__ENCList.Count;
  386.                         }
  387.                         VelocityTabControl.__ENCList.Add(new WeakReference(RuntimeHelpers.GetObjectValue(value)));
  388.                     }
  389.                 }
  390.             }
  391.  
  392.  
  393.             public Helpers.TxtAlign TextAlign
  394.             {
  395.                 get
  396.                 {
  397.                     return this._txtAlign;
  398.                 }
  399.                 set
  400.                 {
  401.                     this._txtAlign = value;
  402.                     this.Invalidate();
  403.                 }
  404.             }
  405.  
  406.             public VelocityTabControl()
  407.             {
  408.                 VelocityTabControl.__ENCAddToList(this);
  409.                 this._overtab = 0;
  410.                 this._txtAlign = Helpers.TxtAlign.Center;
  411.                 this.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
  412.                 this.DoubleBuffered = true;
  413.                 this.SizeMode = TabSizeMode.Fixed;
  414.                 Size itemSize = new Size(40, 130);
  415.                 this.ItemSize = itemSize;
  416.                 this.Alignment = TabAlignment.Left;
  417.                 this.Font = new Font("Segoe UI Semilight", 9f);
  418.             }
  419.  
  420.             protected override void OnPaint(PaintEventArgs e)
  421.             {
  422.                 base.OnPaint(e);
  423.                 Bitmap b = new Bitmap(this.Width, this.Height);
  424.                 Graphics g = Graphics.FromImage(b);
  425.                 g.Clear(Helpers.FromHex("#435363"));
  426.                 int arg_3E_0 = 0;
  427.                 checked
  428.                 {
  429.                     int num = this.TabCount - 1;
  430.                     int i = arg_3E_0;
  431.                     while (true)
  432.                     {
  433.                         int arg_209_0 = i;
  434.                         int num2 = num;
  435.                         if (arg_209_0 > num2)
  436.                         {
  437.                             break;
  438.                         }
  439.                         Rectangle tabRect = this.GetTabRect(i);
  440.                         bool flag = i == this.SelectedIndex;
  441.                         if (flag)
  442.                         {
  443.                             g.FillRectangle(new SolidBrush(Helpers.FromHex("#2c3e50")), tabRect);
  444.                         }
  445.                         else
  446.                         {
  447.                             flag = (i == this._overtab);
  448.                             if (flag)
  449.                             {
  450.                                 g.FillRectangle(new SolidBrush(Helpers.FromHex("#435363")), tabRect);
  451.                             }
  452.                             else
  453.                             {
  454.                                 g.FillRectangle(new SolidBrush(Helpers.FromHex("#38495A")), tabRect);
  455.                             }
  456.                         }
  457.                         switch (this._txtAlign)
  458.                         {
  459.                             case Helpers.TxtAlign.Left:
  460.                                 {
  461.                                     Graphics arg_13E_0 = g;
  462.                                     string arg_13E_1 = this.TabPages[i].Text;
  463.                                     Font arg_13E_2 = this.Font;
  464.                                     Brush arg_13E_3 = Brushes.White;
  465.                                     Rectangle r = new Rectangle(tabRect.X + 8, tabRect.Y, tabRect.Width, tabRect.Height);
  466.                                     arg_13E_0.DrawString(arg_13E_1, arg_13E_2, arg_13E_3, r, new StringFormat
  467.                                     {
  468.                                         Alignment = StringAlignment.Near,
  469.                                         LineAlignment = StringAlignment.Center
  470.                                     });
  471.                                     break;
  472.                                 }
  473.                             case Helpers.TxtAlign.Center:
  474.                                 g.DrawString(this.TabPages[i].Text, this.Font, Brushes.White, tabRect, new StringFormat
  475.                                 {
  476.                                     Alignment = StringAlignment.Center,
  477.                                     LineAlignment = StringAlignment.Center
  478.                                 });
  479.                                 break;
  480.                             case Helpers.TxtAlign.Right:
  481.                                 {
  482.                                     Graphics arg_1F6_0 = g;
  483.                                     string arg_1F6_1 = this.TabPages[i].Text;
  484.                                     Font arg_1F6_2 = this.Font;
  485.                                     Brush arg_1F6_3 = Brushes.White;
  486.                                     Rectangle r = new Rectangle(tabRect.X - 8, tabRect.Y, tabRect.Width, tabRect.Height);
  487.                                     arg_1F6_0.DrawString(arg_1F6_1, arg_1F6_2, arg_1F6_3, r, new StringFormat
  488.                                     {
  489.                                         Alignment = StringAlignment.Far,
  490.                                         LineAlignment = StringAlignment.Center
  491.                                     });
  492.                                     break;
  493.                                 }
  494.                         }
  495.                         i++;
  496.                     }
  497.                     NewLateBinding.LateCall(e.Graphics, null, "DrawImage", new object[]
  498.                 {
  499.                     RuntimeHelpers.GetObjectValue(b.Clone()),
  500.                     0,
  501.                     0
  502.                 }, null, null, null, true);
  503.                     g.Dispose();
  504.                     b.Dispose();
  505.                 }
  506.             }
  507.  
  508.             protected override void OnMouseMove(MouseEventArgs e)
  509.             {
  510.                 base.OnMouseMove(e);
  511.                 int arg_18_0 = 0;
  512.                 checked
  513.                 {
  514.                     int num = this.TabPages.Count - 1;
  515.                     int i = arg_18_0;
  516.                     while (true)
  517.                     {
  518.                         int arg_4E_0 = i;
  519.                         int num2 = num;
  520.                         if (arg_4E_0 > num2)
  521.                         {
  522.                             break;
  523.                         }
  524.                         bool flag = this.GetTabRect(i).Contains(e.Location);
  525.                         if (flag)
  526.                         {
  527.                             this._overtab = i;
  528.                         }
  529.                         this.Invalidate();
  530.                         i++;
  531.                     }
  532.                 }
  533.             }
  534.  
  535.             private static List<WeakReference> __ENCList = new List<WeakReference>();
  536.  
  537.             private int _overtab;
  538.  
  539.             private Helpers.TxtAlign _txtAlign;
  540.         }
  541.         public class VelocitySplitter : Control
  542.         {
  543.  
  544.             private static void __ENCAddToList(object value)
  545.             {
  546.                 List<WeakReference> _ENCList = VelocitySplitter.__ENCList;
  547.                 checked
  548.                 {
  549.                     lock (_ENCList)
  550.                     {
  551.                         bool flag = VelocitySplitter.__ENCList.Count == VelocitySplitter.__ENCList.Capacity;
  552.                         if (flag)
  553.                         {
  554.                             int num = 0;
  555.                             int arg_3F_0 = 0;
  556.                             int num2 = VelocitySplitter.__ENCList.Count - 1;
  557.                             int num3 = arg_3F_0;
  558.                             while (true)
  559.                             {
  560.                                 int arg_90_0 = num3;
  561.                                 int num4 = num2;
  562.                                 if (arg_90_0 > num4)
  563.                                 {
  564.                                     break;
  565.                                 }
  566.                                 WeakReference weakReference = VelocitySplitter.__ENCList[num3];
  567.                                 flag = weakReference.IsAlive;
  568.                                 if (flag)
  569.                                 {
  570.                                     bool flag2 = num3 != num;
  571.                                     if (flag2)
  572.                                     {
  573.                                         VelocitySplitter.__ENCList[num] = VelocitySplitter.__ENCList[num3];
  574.                                     }
  575.                                     num++;
  576.                                 }
  577.                                 num3++;
  578.                             }
  579.                             VelocitySplitter.__ENCList.RemoveRange(num, VelocitySplitter.__ENCList.Count - num);
  580.                             VelocitySplitter.__ENCList.Capacity = VelocitySplitter.__ENCList.Count;
  581.                         }
  582.                         VelocitySplitter.__ENCList.Add(new WeakReference(RuntimeHelpers.GetObjectValue(value)));
  583.                     }
  584.                 }
  585.             }
  586.  
  587.             public int Offset
  588.             {
  589.                 get
  590.                 {
  591.                     return this._offset;
  592.                 }
  593.                 set
  594.                 {
  595.                     this._offset = value;
  596.                     this.Invalidate();
  597.                 }
  598.             }
  599.  
  600.             public VelocitySplitter()
  601.             {
  602.                 VelocitySplitter.__ENCAddToList(this);
  603.                 this._offset = 8;
  604.                 this.DoubleBuffered = true;
  605.             }
  606.  
  607.             protected override void OnPaint(PaintEventArgs e)
  608.             {
  609.                 base.OnPaint(e);
  610.                 Graphics g = e.Graphics;
  611.                 Graphics arg_83_0 = g;
  612.                 Pen arg_83_1 = new Pen(this.ForeColor);
  613.                 checked
  614.                 {
  615.                     Point point = new Point(this._offset, (int)Math.Round(unchecked((double)this.Height / 2.0 - 2.0)));
  616.                     Point arg_83_2 = point;
  617.                     Point pt = new Point(this.Width - this._offset, (int)Math.Round(unchecked((double)this.Height / 2.0 - 1.0)));
  618.                     arg_83_0.DrawLine(arg_83_1, arg_83_2, pt);
  619.                 }
  620.             }
  621.  
  622.             private static List<WeakReference> __ENCList = new List<WeakReference>();
  623.  
  624.             private int _offset;
  625.         }
  626.         [DefaultEvent("CheckChanged")]
  627.         public class VelocityRadioButton : Control
  628.         {
  629.             private static void __ENCAddToList(object value)
  630.             {
  631.                 List<WeakReference> _ENCList = VelocityRadioButton.__ENCList;
  632.                 checked
  633.                 {
  634.                     lock (_ENCList)
  635.                     {
  636.                         bool flag = VelocityRadioButton.__ENCList.Count == VelocityRadioButton.__ENCList.Capacity;
  637.                         if (flag)
  638.                         {
  639.                             int num = 0;
  640.                             int arg_3F_0 = 0;
  641.                             int num2 = VelocityRadioButton.__ENCList.Count - 1;
  642.                             int num3 = arg_3F_0;
  643.                             while (true)
  644.                             {
  645.                                 int arg_90_0 = num3;
  646.                                 int num4 = num2;
  647.                                 if (arg_90_0 > num4)
  648.                                 {
  649.                                     break;
  650.                                 }
  651.                                 WeakReference weakReference = VelocityRadioButton.__ENCList[num3];
  652.                                 flag = weakReference.IsAlive;
  653.                                 if (flag)
  654.                                 {
  655.                                     bool flag2 = num3 != num;
  656.                                     if (flag2)
  657.                                     {
  658.                                         VelocityRadioButton.__ENCList[num] = VelocityRadioButton.__ENCList[num3];
  659.                                     }
  660.                                     num++;
  661.                                 }
  662.                                 num3++;
  663.                             }
  664.                             VelocityRadioButton.__ENCList.RemoveRange(num, VelocityRadioButton.__ENCList.Count - num);
  665.                             VelocityRadioButton.__ENCList.Capacity = VelocityRadioButton.__ENCList.Count;
  666.                         }
  667.                         VelocityRadioButton.__ENCList.Add(new WeakReference(RuntimeHelpers.GetObjectValue(value)));
  668.                     }
  669.                 }
  670.             }
  671.  
  672.             public event VelocityRadioButton.CheckChangedEventHandler CheckChanged
  673.             {
  674.                 [MethodImpl(MethodImplOptions.Synchronized)]
  675.                 add
  676.                 {
  677.                     this.CheckChangedEvent = (VelocityRadioButton.CheckChangedEventHandler)Delegate.Combine(this.CheckChangedEvent, value);
  678.                 }
  679.                 [MethodImpl(MethodImplOptions.Synchronized)]
  680.                 remove
  681.                 {
  682.                     this.CheckChangedEvent = (VelocityRadioButton.CheckChangedEventHandler)Delegate.Remove(this.CheckChangedEvent, value);
  683.                 }
  684.             }
  685.  
  686.             public override bool AutoSize
  687.             {
  688.                 get
  689.                 {
  690.                     return this._autoSize;
  691.                 }
  692.                 set
  693.                 {
  694.                     this._autoSize = value;
  695.                     this.Invalidate();
  696.                 }
  697.             }
  698.  
  699.  
  700.             public bool Checked
  701.             {
  702.                 get
  703.                 {
  704.                     return this._checked;
  705.                 }
  706.                 set
  707.                 {
  708.                     this._checked = value;
  709.                     this.Invalidate();
  710.                 }
  711.             }
  712.  
  713.             public VelocityRadioButton()
  714.             {
  715.                 VelocityRadioButton.__ENCAddToList(this);
  716.                 this._autoSize = true;
  717.                 this._checked = false;
  718.                 this.DoubleBuffered = true;
  719.                 this.InvalidateControls();
  720.             }
  721.  
  722.             protected override void OnPaint(PaintEventArgs e)
  723.             {
  724.                 base.OnPaint(e);
  725.                 bool autoSize = this.AutoSize;
  726.                 bool flag = autoSize;
  727.                 if (flag)
  728.                 {
  729.                     Size size = new Size(checked(TextRenderer.MeasureText(this.Text, this.Font).Width + 24), this.Height);
  730.                     this.Size = size;
  731.                 }
  732.                 Graphics g = e.Graphics;
  733.                 g.SmoothingMode = SmoothingMode.HighQuality;
  734.                 Helpers.MouseState state = this._state;
  735.                 flag = (state == Helpers.MouseState.Hover);
  736.                 if (flag)
  737.                 {
  738.                     g.FillEllipse(new SolidBrush(Helpers.FromHex("#DBDBDB")), 4, 4, 14, 14);
  739.                 }
  740.                 else
  741.                 {
  742.                     g.FillEllipse(Brushes.White, 4, 4, 14, 14);
  743.                 }
  744.                 Graphics arg_C3_0 = g;
  745.                 Pen arg_C3_1 = new Pen(Helpers.FromHex("#435363"));
  746.                 Rectangle rectangle = new Rectangle(4, 4, 14, 14);
  747.                 arg_C3_0.DrawEllipse(arg_C3_1, rectangle);
  748.                 Graphics arg_111_0 = g;
  749.                 string arg_111_1 = this.Text;
  750.                 Font arg_111_2 = this.Font;
  751.                 Brush arg_111_3 = new SolidBrush(this.ForeColor);
  752.                 rectangle = new Rectangle(22, 0, this.Width, this.Height);
  753.                 arg_111_0.DrawString(arg_111_1, arg_111_2, arg_111_3, rectangle, new StringFormat
  754.                 {
  755.                     LineAlignment = StringAlignment.Center
  756.                 });
  757.                 flag = this._checked;
  758.                 if (flag)
  759.                 {
  760.                     g.FillEllipse(new SolidBrush(Helpers.FromHex("#435363")), 7, 7, 8, 8);
  761.                 }
  762.             }
  763.  
  764.             private void InvalidateControls()
  765.             {
  766.                 bool flag = !this.IsHandleCreated || !this._checked;
  767.                 if (!flag)
  768.                 {
  769.                     try
  770.                     {
  771.                         IEnumerator enumerator = this.Parent.Controls.GetEnumerator();
  772.                         while (enumerator.MoveNext())
  773.                         {
  774.                             Control C = (Control)enumerator.Current;
  775.                             flag = (C != this && C is VelocityRadioButton);
  776.                             if (flag)
  777.                             {
  778.                                 ((VelocityRadioButton)C).Checked = false;
  779.                                 this.Invalidate();
  780.                             }
  781.                         }
  782.                     }
  783.                     finally
  784.                     {
  785.                         IEnumerator enumerator =this.Parent.Controls.GetEnumerator();
  786.                         flag = (enumerator is IDisposable);
  787.                         if (flag)
  788.                         {
  789.                             (enumerator as IDisposable).Dispose();
  790.                         }
  791.                     }
  792.                 }
  793.             }
  794.  
  795.             protected override void OnTextChanged(EventArgs e)
  796.             {
  797.                 base.OnTextChanged(e);
  798.                 this.Invalidate();
  799.             }
  800.  
  801.             protected override void OnMouseUp(MouseEventArgs e)
  802.             {
  803.                 base.OnMouseUp(e);
  804.                 this._state = Helpers.MouseState.Hover;
  805.                 switch (this.Checked)
  806.                 {
  807.                     case false:
  808.                         this.Checked = true;
  809.                         break;
  810.                     case true:
  811.                         this.Checked = false;
  812.                         break;
  813.                 }
  814.                 this._state = Helpers.MouseState.Hover;
  815.                 this.InvalidateControls();
  816.             }
  817.  
  818.             protected override void OnMouseHover(EventArgs e)
  819.             {
  820.                 base.OnMouseHover(e);
  821.                 this._state = Helpers.MouseState.Hover;
  822.                 this.Invalidate();
  823.             }
  824.  
  825.             protected override void OnMouseLeave(EventArgs e)
  826.             {
  827.                 base.OnMouseLeave(e);
  828.                 this._state = Helpers.MouseState.None;
  829.                 this.Invalidate();
  830.             }
  831.  
  832.             protected override void OnMouseDown(MouseEventArgs e)
  833.             {
  834.                 base.OnMouseDown(e);
  835.                 this._state = Helpers.MouseState.None;
  836.                 this.Invalidate();
  837.             }
  838.  
  839.             protected override void OnResize(EventArgs e)
  840.             {
  841.                 base.OnResize(e);
  842.                 this.Invalidate();
  843.             }
  844.  
  845.             private static List<WeakReference> __ENCList = new List<WeakReference>();
  846.  
  847.             private Helpers.MouseState _state;
  848.  
  849.             private VelocityRadioButton.CheckChangedEventHandler CheckChangedEvent;
  850.  
  851.             private bool _autoSize;
  852.  
  853.             private bool _checked;
  854.  
  855.  
  856.             public delegate void CheckChangedEventHandler(object sender, EventArgs e);
  857.         }
  858.         public class VelocityProgressBar : Control
  859.         {
  860.             private static void __ENCAddToList(object value)
  861.             {
  862.                 List<WeakReference> _ENCList = VelocityProgressBar.__ENCList;
  863.                 checked
  864.                 {
  865.                     lock (_ENCList)
  866.                     {
  867.                         bool flag = VelocityProgressBar.__ENCList.Count == VelocityProgressBar.__ENCList.Capacity;
  868.                         if (flag)
  869.                         {
  870.                             int num = 0;
  871.                             int arg_3F_0 = 0;
  872.                             int num2 = VelocityProgressBar.__ENCList.Count - 1;
  873.                             int num3 = arg_3F_0;
  874.                             while (true)
  875.                             {
  876.                                 int arg_90_0 = num3;
  877.                                 int num4 = num2;
  878.                                 if (arg_90_0 > num4)
  879.                                 {
  880.                                     break;
  881.                                 }
  882.                                 WeakReference weakReference = VelocityProgressBar.__ENCList[num3];
  883.                                 flag = weakReference.IsAlive;
  884.                                 if (flag)
  885.                                 {
  886.                                     bool flag2 = num3 != num;
  887.                                     if (flag2)
  888.                                     {
  889.                                         VelocityProgressBar.__ENCList[num] = VelocityProgressBar.__ENCList[num3];
  890.                                     }
  891.                                     num++;
  892.                                 }
  893.                                 num3++;
  894.                             }
  895.                             VelocityProgressBar.__ENCList.RemoveRange(num, VelocityProgressBar.__ENCList.Count - num);
  896.                             VelocityProgressBar.__ENCList.Capacity = VelocityProgressBar.__ENCList.Count;
  897.                         }
  898.                         VelocityProgressBar.__ENCList.Add(new WeakReference(RuntimeHelpers.GetObjectValue(value)));
  899.                     }
  900.                 }
  901.             }
  902.  
  903.  
  904.             public Color Border
  905.             {
  906.                 get
  907.                 {
  908.                     return this._border;
  909.                 }
  910.                 set
  911.                 {
  912.                     this._border = value;
  913.                     this.Invalidate();
  914.                 }
  915.             }
  916.  
  917.             public Color ProgressColor
  918.             {
  919.                 get
  920.                 {
  921.                     return this._progressColor;
  922.                 }
  923.                 set
  924.                 {
  925.                     this._progressColor = value;
  926.                     this.Invalidate();
  927.                 }
  928.             }
  929.  
  930.             public int Value
  931.             {
  932.                 get
  933.                 {
  934.                     return this._val;
  935.                 }
  936.                 set
  937.                 {
  938.                     this._val = value;
  939.                     this.ValChanged();
  940.                     this.Invalidate();
  941.                 }
  942.             }
  943.  
  944.  
  945.             public int Min
  946.             {
  947.                 get
  948.                 {
  949.                     return this._min;
  950.                 }
  951.                 set
  952.                 {
  953.                     this._min = value;
  954.                     this.Invalidate();
  955.                 }
  956.             }
  957.  
  958.  
  959.             public int Max
  960.             {
  961.                 get
  962.                 {
  963.                     return this._max;
  964.                 }
  965.                 set
  966.                 {
  967.                     this._max = value;
  968.                     this.Invalidate();
  969.                 }
  970.             }
  971.  
  972.  
  973.             public bool ShowPercent
  974.             {
  975.                 get
  976.                 {
  977.                     return this._showPercent;
  978.                 }
  979.                 set
  980.                 {
  981.                     this._showPercent = value;
  982.                     this.Invalidate();
  983.                 }
  984.             }
  985.  
  986.             private void ValChanged()
  987.             {
  988.                 bool flag = this._val > this._max;
  989.                 if (flag)
  990.                 {
  991.                     this._val = this._max;
  992.                 }
  993.             }
  994.  
  995.             public VelocityProgressBar()
  996.             {
  997.                 VelocityProgressBar.__ENCAddToList(this);
  998.                 this._border = Helpers.FromHex("#485e75");
  999.                 this._progressColor = Helpers.FromHex("#2c3e50");
  1000.                 this._val = 0;
  1001.                 this._min = 0;
  1002.                 this._max = 100;
  1003.                 this._showPercent = false;
  1004.                 this.DoubleBuffered = true;
  1005.             }
  1006.  
  1007.             protected override void OnPaint(PaintEventArgs e)
  1008.             {
  1009.                 base.OnPaint(e);
  1010.                 Graphics g = e.Graphics;
  1011.                 bool showPercent = this._showPercent;
  1012.                 checked
  1013.                 {
  1014.                     if (showPercent)
  1015.                     {
  1016.                         g.FillRectangle(new SolidBrush(Helpers.FromHex("#506070")), 0, 0, this.Width - 35, this.Height - 1);
  1017.                         Graphics arg_89_0 = g;
  1018.                         Brush arg_89_1 = new SolidBrush(this._progressColor);
  1019.                         Rectangle rect = new Rectangle(0, 0, (int)Math.Round((double)(this._val * (this.Width - 35)) / (double)(this._max - this._min)), this.Height);
  1020.                         arg_89_0.FillRectangle(arg_89_1, rect);
  1021.                         g.DrawRectangle(new Pen(Color.Black), 0, 0, this.Width - 35, this.Height - 1);
  1022.                         g.DrawString(Conversions.ToString(this._val) + "%", this.Font, new SolidBrush(this.ForeColor), (float)(this.Width - 30), (float)(unchecked((double)this.Height / 2.0 - (double)(g.MeasureString(Conversions.ToString(this._val) + "%", this.Font).Height / 2f) - 1.0)));
  1023.                     }
  1024.                     else
  1025.                     {
  1026.                         g.Clear(Helpers.FromHex("#506070"));
  1027.                         Graphics arg_19C_0 = g;
  1028.                         Brush arg_19C_1 = new SolidBrush(this._progressColor);
  1029.                         Rectangle rect = new Rectangle(0, 0, (int)Math.Round(unchecked(checked((double)((this._val - 0) * (this.Width - 0)) / (double)(this._max - this._min)) + 0.0)), this.Height);
  1030.                         arg_19C_0.FillRectangle(arg_19C_1, rect);
  1031.                         g.DrawRectangle(new Pen(Color.Black), 0, 0, this.Width - 1, this.Height - 1);
  1032.                     }
  1033.                 }
  1034.             }
  1035.  
  1036.             private static List<WeakReference> __ENCList = new List<WeakReference>();
  1037.  
  1038.             private Color _border;
  1039.  
  1040.             private Color _progressColor;
  1041.  
  1042.             private int _val;
  1043.  
  1044.             private int _min;
  1045.  
  1046.             private int _max;
  1047.  
  1048.             private bool _showPercent;
  1049.         }
  1050.         [DefaultEvent("CheckChanged")]
  1051.         public class VelocityCheckBox : Control
  1052.         {
  1053.  
  1054.             private static void __ENCAddToList(object value)
  1055.             {
  1056.                 List<WeakReference> _ENCList = VelocityCheckBox.__ENCList;
  1057.                 checked
  1058.                 {
  1059.                     lock (_ENCList)
  1060.                     {
  1061.                         bool flag = VelocityCheckBox.__ENCList.Count == VelocityCheckBox.__ENCList.Capacity;
  1062.                         if (flag)
  1063.                         {
  1064.                             int num = 0;
  1065.                             int arg_3F_0 = 0;
  1066.                             int num2 = VelocityCheckBox.__ENCList.Count - 1;
  1067.                             int num3 = arg_3F_0;
  1068.                             while (true)
  1069.                             {
  1070.                                 int arg_90_0 = num3;
  1071.                                 int num4 = num2;
  1072.                                 if (arg_90_0 > num4)
  1073.                                 {
  1074.                                     break;
  1075.                                 }
  1076.                                 WeakReference weakReference = VelocityCheckBox.__ENCList[num3];
  1077.                                 flag = weakReference.IsAlive;
  1078.                                 if (flag)
  1079.                                 {
  1080.                                     bool flag2 = num3 != num;
  1081.                                     if (flag2)
  1082.                                     {
  1083.                                         VelocityCheckBox.__ENCList[num] = VelocityCheckBox.__ENCList[num3];
  1084.                                     }
  1085.                                     num++;
  1086.                                 }
  1087.                                 num3++;
  1088.                             }
  1089.                             VelocityCheckBox.__ENCList.RemoveRange(num, VelocityCheckBox.__ENCList.Count - num);
  1090.                             VelocityCheckBox.__ENCList.Capacity = VelocityCheckBox.__ENCList.Count;
  1091.                         }
  1092.                         VelocityCheckBox.__ENCList.Add(new WeakReference(RuntimeHelpers.GetObjectValue(value)));
  1093.                     }
  1094.                 }
  1095.             }
  1096.  
  1097.  
  1098.             public event VelocityCheckBox.CheckChangedEventHandler CheckChanged
  1099.             {
  1100.                 [MethodImpl(MethodImplOptions.Synchronized)]
  1101.                 add
  1102.                 {
  1103.                     this.CheckChangedEvent = (VelocityCheckBox.CheckChangedEventHandler)Delegate.Combine(this.CheckChangedEvent, value);
  1104.                 }
  1105.                 [MethodImpl(MethodImplOptions.Synchronized)]
  1106.                 remove
  1107.                 {
  1108.                     this.CheckChangedEvent = (VelocityCheckBox.CheckChangedEventHandler)Delegate.Remove(this.CheckChangedEvent, value);
  1109.                 }
  1110.             }
  1111.             public override bool AutoSize
  1112.             {
  1113.                 get
  1114.                 {
  1115.                     return this._autoSize;
  1116.                 }
  1117.                 set
  1118.                 {
  1119.                     this._autoSize = value;
  1120.                     this.Invalidate();
  1121.                 }
  1122.             }
  1123.  
  1124.             public bool Checked
  1125.             {
  1126.                 get
  1127.                 {
  1128.                     return this._checked;
  1129.                 }
  1130.                 set
  1131.                 {
  1132.                     this._checked = value;
  1133.                     this.Invalidate();
  1134.                 }
  1135.             }
  1136.  
  1137.             public VelocityCheckBox()
  1138.             {
  1139.                 VelocityCheckBox.__ENCAddToList(this);
  1140.                 this._state = Helpers.MouseState.None;
  1141.                 this._autoSize = true;
  1142.                 this._checked = false;
  1143.                 this.DoubleBuffered = true;
  1144.             }
  1145.  
  1146.             protected override void OnPaint(PaintEventArgs e)
  1147.             {
  1148.                 base.OnPaint(e);
  1149.                 bool autoSize = this.AutoSize;
  1150.                 bool flag = autoSize;
  1151.                 if (flag)
  1152.                 {
  1153.                     Size size = new Size(checked(TextRenderer.MeasureText(this.Text, this.Font).Width + 28), this.Height);
  1154.                     this.Size = size;
  1155.                 }
  1156.                 Graphics g = e.Graphics;
  1157.                 Helpers.MouseState state = this._state;
  1158.                 flag = (state == Helpers.MouseState.Hover);
  1159.                 if (flag)
  1160.                 {
  1161.                     g.FillRectangle(new SolidBrush(Helpers.FromHex("#DBDBDB")), 4, 4, 14, 14);
  1162.                 }
  1163.                 else
  1164.                 {
  1165.                     g.FillRectangle(Brushes.White, 4, 4, 14, 14);
  1166.                 }
  1167.                 flag = this._checked;
  1168.                 if (flag)
  1169.                 {
  1170.                     g.FillRectangle(new SolidBrush(Helpers.FromHex("#435363")), 7, 7, 9, 9);
  1171.                 }
  1172.                 Graphics arg_E4_0 = g;
  1173.                 Pen arg_E4_1 = new Pen(Helpers.FromHex("#435363"));
  1174.                 Rectangle rectangle = new Rectangle(4, 4, 14, 14);
  1175.                 arg_E4_0.DrawRectangle(arg_E4_1, rectangle);
  1176.                 Graphics arg_132_0 = g;
  1177.                 string arg_132_1 = this.Text;
  1178.                 Font arg_132_2 = this.Font;
  1179.                 Brush arg_132_3 = new SolidBrush(this.ForeColor);
  1180.                 rectangle = new Rectangle(22, 0, this.Width, this.Height);
  1181.                 arg_132_0.DrawString(arg_132_1, arg_132_2, arg_132_3, rectangle, new StringFormat
  1182.                 {
  1183.                     LineAlignment = StringAlignment.Center
  1184.                 });
  1185.             }
  1186.  
  1187.             protected override void OnTextChanged(EventArgs e)
  1188.             {
  1189.                 base.OnTextChanged(e);
  1190.                 this.Invalidate();
  1191.             }
  1192.  
  1193.             protected override void OnMouseUp(MouseEventArgs e)
  1194.             {
  1195.                 base.OnMouseUp(e);
  1196.                 switch (this.Checked)
  1197.                 {
  1198.                     case false:
  1199.                         this.Checked = true;
  1200.                         break;
  1201.                     case true:
  1202.                         this.Checked = false;
  1203.                         break;
  1204.                 }
  1205.                 this._state = Helpers.MouseState.Hover;
  1206.                 this.Invalidate();
  1207.             }
  1208.  
  1209.             protected override void OnMouseEnter(EventArgs e)
  1210.             {
  1211.                 base.OnMouseEnter(e);
  1212.                 this._state = Helpers.MouseState.Hover;
  1213.                 this.Invalidate();
  1214.             }
  1215.  
  1216.             protected override void OnMouseHover(EventArgs e)
  1217.             {
  1218.                 base.OnMouseHover(e);
  1219.                 this._state = Helpers.MouseState.Hover;
  1220.                 this.Invalidate();
  1221.             }
  1222.  
  1223.             protected override void OnMouseLeave(EventArgs e)
  1224.             {
  1225.                 base.OnMouseLeave(e);
  1226.                 this._state = Helpers.MouseState.None;
  1227.                 this.Invalidate();
  1228.             }
  1229.  
  1230.             protected override void OnMouseDown(MouseEventArgs e)
  1231.             {
  1232.                 base.OnMouseDown(e);
  1233.                 this._state = Helpers.MouseState.Down;
  1234.                 this.Invalidate();
  1235.             }
  1236.  
  1237.             protected override void OnResize(EventArgs e)
  1238.             {
  1239.                 base.OnResize(e);
  1240.                 this.Invalidate();
  1241.             }
  1242.  
  1243.             private static List<WeakReference> __ENCList = new List<WeakReference>();
  1244.  
  1245.             private Helpers.MouseState _state;
  1246.  
  1247.             private VelocityCheckBox.CheckChangedEventHandler CheckChangedEvent;
  1248.  
  1249.             private bool _autoSize;
  1250.  
  1251.             private bool _checked;
  1252.             public delegate void CheckChangedEventHandler(object sender, EventArgs e);
  1253.         }
  1254.         public class VelocityButton : Control
  1255.         {
  1256.  
  1257.             private static void __ENCAddToList(object value)
  1258.             {
  1259.                 List<WeakReference> _ENCList = VelocityButton.__ENCList;
  1260.                 checked
  1261.                 {
  1262.                     lock (_ENCList)
  1263.                     {
  1264.                         bool flag = VelocityButton.__ENCList.Count == VelocityButton.__ENCList.Capacity;
  1265.                         if (flag)
  1266.                         {
  1267.                             int num = 0;
  1268.                             int arg_3F_0 = 0;
  1269.                             int num2 = VelocityButton.__ENCList.Count - 1;
  1270.                             int num3 = arg_3F_0;
  1271.                             while (true)
  1272.                             {
  1273.                                 int arg_90_0 = num3;
  1274.                                 int num4 = num2;
  1275.                                 if (arg_90_0 > num4)
  1276.                                 {
  1277.                                     break;
  1278.                                 }
  1279.                                 WeakReference weakReference = VelocityButton.__ENCList[num3];
  1280.                                 flag = weakReference.IsAlive;
  1281.                                 if (flag)
  1282.                                 {
  1283.                                     bool flag2 = num3 != num;
  1284.                                     if (flag2)
  1285.                                     {
  1286.                                         VelocityButton.__ENCList[num] = VelocityButton.__ENCList[num3];
  1287.                                     }
  1288.                                     num++;
  1289.                                 }
  1290.                                 num3++;
  1291.                             }
  1292.                             VelocityButton.__ENCList.RemoveRange(num, VelocityButton.__ENCList.Count - num);
  1293.                             VelocityButton.__ENCList.Capacity = VelocityButton.__ENCList.Count;
  1294.                         }
  1295.                         VelocityButton.__ENCList.Add(new WeakReference(RuntimeHelpers.GetObjectValue(value)));
  1296.                     }
  1297.                 }
  1298.             }
  1299.  
  1300.  
  1301.             public Helpers.TxtAlign TextAlign
  1302.             {
  1303.                 get
  1304.                 {
  1305.                     return this._txtAlign;
  1306.                 }
  1307.                 set
  1308.                 {
  1309.                     this._txtAlign = value;
  1310.                     this.Invalidate();
  1311.                 }
  1312.             }
  1313.  
  1314.             public VelocityButton()
  1315.             {
  1316.                 VelocityButton.__ENCAddToList(this);
  1317.                 this.state = Helpers.MouseState.None;
  1318.                 this._enabled = true;
  1319.                 this._txtAlign = Helpers.TxtAlign.Center;
  1320.                 this.DoubleBuffered = true;
  1321.                 this.Font = new Font("Segoe UI Semilight", 9f);
  1322.                 this.ForeColor = Color.White;
  1323.                 Size size = new Size(94, 40);
  1324.                 this.Size = size;
  1325.             }
  1326.  
  1327.             public new bool Enabled
  1328.             {
  1329.                 get
  1330.                 {
  1331.                     return this._enabled;
  1332.                 }
  1333.                 set
  1334.                 {
  1335.                     this._enabled = value;
  1336.                     this.Invalidate();
  1337.                 }
  1338.             }
  1339.  
  1340.             public void PerformClick()
  1341.             {
  1342.                 base.OnClick(EventArgs.Empty);
  1343.             }
  1344.             protected override void OnPaint(PaintEventArgs e)
  1345.             {
  1346.                 base.OnPaint(e);
  1347.                 Graphics g = e.Graphics;
  1348.                 checked
  1349.                 {
  1350.                     switch (this._enabled)
  1351.                     {
  1352.                         case false:
  1353.                             g.Clear(Helpers.FromHex("#38495A"));
  1354.                             break;
  1355.                         case true:
  1356.                             switch (this.state)
  1357.                             {
  1358.                                 case Helpers.MouseState.Hover:
  1359.                                     g.Clear(Helpers.FromHex("#38495A"));
  1360.                                     break;
  1361.                                 case Helpers.MouseState.Down:
  1362.                                     g.Clear(this.BackColor);
  1363.                                     g.FillRectangle(new SolidBrush(Helpers.FromHex("#2c3e50")), 1, 1, this.Width - 2, this.Height - 2);
  1364.                                     break;
  1365.                                 case Helpers.MouseState.None:
  1366.                                     g.Clear(Helpers.FromHex("#435363"));
  1367.                                     break;
  1368.                             }
  1369.                             break;
  1370.                     }
  1371.                     switch (this._txtAlign)
  1372.                     {
  1373.                         case Helpers.TxtAlign.Left:
  1374.                             {
  1375.                                 Graphics arg_136_0 = g;
  1376.                                 string arg_136_1 = this.Text;
  1377.                                 Font arg_136_2 = this.Font;
  1378.                                 Brush arg_136_3 = new SolidBrush(this.ForeColor);
  1379.                                 Rectangle r = new Rectangle(8, 0, this.Width, this.Height);
  1380.                                 arg_136_0.DrawString(arg_136_1, arg_136_2, arg_136_3, r, new StringFormat
  1381.                                 {
  1382.                                     Alignment = StringAlignment.Near,
  1383.                                     LineAlignment = StringAlignment.Center
  1384.                                 });
  1385.                                 break;
  1386.                             }
  1387.                         case Helpers.TxtAlign.Center:
  1388.                             {
  1389.                                 Graphics arg_192_0 = g;
  1390.                                 string arg_192_1 = this.Text;
  1391.                                 Font arg_192_2 = this.Font;
  1392.                                 Brush arg_192_3 = new SolidBrush(this.ForeColor);
  1393.                                 Rectangle r = new Rectangle(0, 0, this.Width, this.Height);
  1394.                                 arg_192_0.DrawString(arg_192_1, arg_192_2, arg_192_3, r, new StringFormat
  1395.                                 {
  1396.                                     Alignment = StringAlignment.Center,
  1397.                                     LineAlignment = StringAlignment.Center
  1398.                                 });
  1399.                                 break;
  1400.                             }
  1401.                         case Helpers.TxtAlign.Right:
  1402.                             {
  1403.                                 Graphics arg_1ED_0 = g;
  1404.                                 string arg_1ED_1 = this.Text;
  1405.                                 Font arg_1ED_2 = this.Font;
  1406.                                 Brush arg_1ED_3 = new SolidBrush(this.ForeColor);
  1407.                                 Rectangle r = new Rectangle(0, 0, this.Width - 8, this.Height);
  1408.                                 arg_1ED_0.DrawString(arg_1ED_1, arg_1ED_2, arg_1ED_3, r, new StringFormat
  1409.                                 {
  1410.                                     Alignment = StringAlignment.Far,
  1411.                                     LineAlignment = StringAlignment.Center
  1412.                                 });
  1413.                                 break;
  1414.                             }
  1415.                     }
  1416.                 }
  1417.             }
  1418.  
  1419.             protected override void OnMouseEnter(EventArgs e)
  1420.             {
  1421.                 base.OnMouseEnter(e);
  1422.                 this.state = Helpers.MouseState.Hover;
  1423.                 this.Invalidate();
  1424.             }
  1425.  
  1426.             protected override void OnMouseHover(EventArgs e)
  1427.             {
  1428.                 base.OnMouseHover(e);
  1429.                 this.state = Helpers.MouseState.Hover;
  1430.                 this.Invalidate();
  1431.             }
  1432.  
  1433.             protected override void OnMouseLeave(EventArgs e)
  1434.             {
  1435.                 base.OnMouseLeave(e);
  1436.                 this.state = Helpers.MouseState.None;
  1437.                 this.Invalidate();
  1438.             }
  1439.  
  1440.             protected override void OnMouseDown(MouseEventArgs e)
  1441.             {
  1442.                 base.OnMouseDown(e);
  1443.                 this.state = Helpers.MouseState.Down;
  1444.                 this.Invalidate();
  1445.             }
  1446.  
  1447.             protected override void OnMouseUp(MouseEventArgs e)
  1448.             {
  1449.                 base.OnMouseUp(e);
  1450.                 this.state = Helpers.MouseState.Hover;
  1451.                 this.Invalidate();
  1452.             }
  1453.  
  1454.             protected override void OnTextChanged(EventArgs e)
  1455.             {
  1456.                 base.OnTextChanged(e);
  1457.                 this.Invalidate();
  1458.             }
  1459.  
  1460.             private static List<WeakReference> __ENCList = new List<WeakReference>();
  1461.  
  1462.             private Helpers.MouseState state;
  1463.  
  1464.             private bool _enabled;
  1465.  
  1466.             private Helpers.TxtAlign _txtAlign;
  1467.         }
  1468.         public class VelocityAlert : Control
  1469.         {
  1470.             private static void __ENCAddToList(object value)
  1471.             {
  1472.                 List<WeakReference> _ENCList = VelocityAlert.__ENCList;
  1473.                 checked
  1474.                 {
  1475.                     lock (_ENCList)
  1476.                     {
  1477.                         bool flag = VelocityAlert.__ENCList.Count == VelocityAlert.__ENCList.Capacity;
  1478.                         if (flag)
  1479.                         {
  1480.                             int num = 0;
  1481.                             int arg_3F_0 = 0;
  1482.                             int num2 = VelocityAlert.__ENCList.Count - 1;
  1483.                             int num3 = arg_3F_0;
  1484.                             while (true)
  1485.                             {
  1486.                                 int arg_90_0 = num3;
  1487.                                 int num4 = num2;
  1488.                                 if (arg_90_0 > num4)
  1489.                                 {
  1490.                                     break;
  1491.                                 }
  1492.                                 WeakReference weakReference = VelocityAlert.__ENCList[num3];
  1493.                                 flag = weakReference.IsAlive;
  1494.                                 if (flag)
  1495.                                 {
  1496.                                     bool flag2 = num3 != num;
  1497.                                     if (flag2)
  1498.                                     {
  1499.                                         VelocityAlert.__ENCList[num] = VelocityAlert.__ENCList[num3];
  1500.                                     }
  1501.                                     num++;
  1502.                                 }
  1503.                                 num3++;
  1504.                             }
  1505.                             VelocityAlert.__ENCList.RemoveRange(num, VelocityAlert.__ENCList.Count - num);
  1506.                             VelocityAlert.__ENCList.Capacity = VelocityAlert.__ENCList.Count;
  1507.                         }
  1508.                         VelocityAlert.__ENCList.Add(new WeakReference(RuntimeHelpers.GetObjectValue(value)));
  1509.                     }
  1510.                 }
  1511.             }
  1512.  
  1513.  
  1514.             public event VelocityAlert.XClickedEventHandler XClicked
  1515.             {
  1516.                 [MethodImpl(MethodImplOptions.Synchronized)]
  1517.                 add
  1518.                 {
  1519.                     this.XClickedEvent = (VelocityAlert.XClickedEventHandler)Delegate.Combine(this.XClickedEvent, value);
  1520.                 }
  1521.                 [MethodImpl(MethodImplOptions.Synchronized)]
  1522.                 remove
  1523.                 {
  1524.                     this.XClickedEvent = (VelocityAlert.XClickedEventHandler)Delegate.Remove(this.XClickedEvent, value);
  1525.                 }
  1526.             }
  1527.  
  1528.             public bool XChangeCursor
  1529.             {
  1530.                 get
  1531.                 {
  1532.                     return this._xChangeCursor;
  1533.                 }
  1534.                 set
  1535.                 {
  1536.                     this._xChangeCursor = value;
  1537.                     this.Invalidate();
  1538.                 }
  1539.             }
  1540.  
  1541.             public string Title
  1542.             {
  1543.                 get
  1544.                 {
  1545.                     return this._title;
  1546.                 }
  1547.                 set
  1548.                 {
  1549.                     this._title = value;
  1550.                     this.Invalidate();
  1551.                 }
  1552.             }
  1553.  
  1554.             public bool ShowExit
  1555.             {
  1556.                 get
  1557.                 {
  1558.                     return this._exitButton;
  1559.                 }
  1560.                 set
  1561.                 {
  1562.                     this._exitButton = value;
  1563.                     this.Invalidate();
  1564.                 }
  1565.             }
  1566.  
  1567.  
  1568.             public bool ShowImage
  1569.             {
  1570.                 get
  1571.                 {
  1572.                     return this._showImage;
  1573.                 }
  1574.                 set
  1575.                 {
  1576.                     this._showImage = value;
  1577.                     this.Invalidate();
  1578.                 }
  1579.             }
  1580.  
  1581.  
  1582.             public Image Image
  1583.             {
  1584.                 get
  1585.                 {
  1586.                     return this._image;
  1587.                 }
  1588.                 set
  1589.                 {
  1590.                     this._image = value;
  1591.                     this.Invalidate();
  1592.                 }
  1593.             }
  1594.  
  1595.  
  1596.             public Color Border
  1597.             {
  1598.                 get
  1599.                 {
  1600.                     return this._border;
  1601.                 }
  1602.                 set
  1603.                 {
  1604.                     this._border = value;
  1605.                     this.Invalidate();
  1606.                 }
  1607.             }
  1608.  
  1609.             public VelocityAlert()
  1610.             {
  1611.                 VelocityAlert.__ENCAddToList(this);
  1612.                 this._xHover = false;
  1613.                 this.FillerImage = "iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAAlC+aJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTM0A1t6AAADZUlEQVRoQ+2W2ytsYRjG9x85Cikpp1KORSkihITkyinkdCERm0wi3IiS5ELKIQkXkiQkh9m/tZ7PNHuwWi707dl9v4vpfd/1zut51ncYvyIpzv9iIJaCSLkzYA8pdwbsIeXOgD2k3Bmwh5Q7A/aQcmfAHlLuDNhDyp0Be0i5M2APKXcG7CHlzoA9pPx7Bh4fH4+Pj/f29m5vb03pHSpnZ2cmCeTt7Y1OhlxdXZnSO8/PzyGHgJR/w8Dc3Fx6err6s7OzTdXn9fW1sLCQ+urqqil9AQ15eXkaAkdHR+aBT21tLcWJiQmTB6IJYQ1sbW3RtrKyovTy8lKBGBsb05zl5WVT+ozT01N6pqenlSatwNLSkoaMjIyYUiBqDmugoaGhr6/PJH/DojNhf3+fz2g0SoXPqampu7s7Nfz2Iejt7W1sbFQxiaenJ1YG/wwZHBw01UA83eENsHnW1tZ4Z4eHh/f396bq09bW1tLSQpE5MgBFRUWdnZ0EJycn1Dc2NojLysrYHhhjSNIpGh4ezs/PJ6C5v79fxWA83SENXF9f01NVVaVmGBgY0KPNzU1SgiQDKCZlx1dUVHR0dKiYlZVVWlrqfd+nvb1ddS4G0ouLC2ICFkr1YPwZ4Qycn5/TMzQ0pHRmZoYU6cTl5eXaHkkGoLm52Rsdidzc3JBy+RC3trZqASV6dnaWmAXs6enxvvNDBlh0era3t00eixUUFKCb45iZmcnqj4+P6xwjJf5eFxYWqLACSiEnJ4erzCSxWF1dHedKa8W+ZwIbjJillrFg6ISwZyA3N3d+fl4xvwZpaWmsAAa6u7u7uro4Bk1NTcwpLi4uKSmhhy3OsRkdHaUY/2JNTU187wHNTMAAQwDnGsJhYKZp+hpPd3gD/IHq6moOw8vLC++JG4O73zzzeXh4YA4HXSn99fX1BLzajIwM7aLJyUl+Lg4ODogXFxfpZ3N63QmwpD9yjfJGWXE18+Z2d3fNg3cSDezs7BDHf1MrKytJFbNW3ohIhO20vr6uYiIsNXvJJIFoTlgDgs3DhW2SD3z8/+JTmJB0EScScghI+fcM/FNIuTNgDyl3Buwh5c6APaTcGbCHlDsD9pByZ8AeUu4M2EPKnQF7SLkzYA8pdwbsIeXOgD2k3Bmwh5QbA6lLihuIRP4AXubLj7lh8ksAAAAASUVORK5CYII=";
  1614.                 this._xChangeCursor = true;
  1615.                 this._title = this.Name;
  1616.                 this._exitButton = false;
  1617.                 this._showImage = true;
  1618.                 this._border = Helpers.FromHex("#435363");
  1619.                 Size size = new Size(370, 80);
  1620.                 this.Size = size;
  1621.                 this.DoubleBuffered = true;
  1622.             }
  1623.  
  1624.             protected override void OnPaint(PaintEventArgs e)
  1625.             {
  1626.                 base.OnPaint(e);
  1627.                 Graphics g = e.Graphics;
  1628.                 g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
  1629.                 checked
  1630.                 {
  1631.                     bool flag;
  1632.                     switch (this.ShowImage)
  1633.                     {
  1634.                         case false:
  1635.                             {
  1636.                                 g.DrawString(this._title, new Font("Segoe UI Semilight", 14f), new SolidBrush(this.ForeColor), 18f, 6f);
  1637.                                 Graphics arg_153_0 = g;
  1638.                                 string arg_153_1 = this.Text;
  1639.                                 Font arg_153_2 = this.Font;
  1640.                                 Brush arg_153_3 = new SolidBrush(this.ForeColor);
  1641.                                 Rectangle r = new Rectangle(20, 33, this.Width - 28, this.Height - 10);
  1642.                                 arg_153_0.DrawString(arg_153_1, arg_153_2, arg_153_3, r);
  1643.                                 break;
  1644.                             }
  1645.                         case true:
  1646.                             {
  1647.                                 flag = (this._image == null);
  1648.                                 if (flag)
  1649.                                 {
  1650.                                     g.DrawImage(Helpers.b64Image(this.FillerImage), 13, 8);
  1651.                                 }
  1652.                                 else
  1653.                                 {
  1654.                                     g.DrawImage(this._image, 12, 8, 64, 64);
  1655.                                 }
  1656.                                 g.DrawString(this._title, new Font("Segoe UI Semilight", 14f), new SolidBrush(this.ForeColor), 84f, 6f);
  1657.                                 Graphics arg_DD_0 = g;
  1658.                                 string arg_DD_1 = this.Text;
  1659.                                 Font arg_DD_2 = this.Font;
  1660.                                 Brush arg_DD_3 = new SolidBrush(this.ForeColor);
  1661.                                 Rectangle r = new Rectangle(86, 33, this.Width - 88, this.Height - 10);
  1662.                                 arg_DD_0.DrawString(arg_DD_1, arg_DD_2, arg_DD_3, r);
  1663.                                 break;
  1664.                             }
  1665.                     }
  1666.                     flag = this.ShowExit;
  1667.                     if (flag)
  1668.                     {
  1669.                         bool xHover = this._xHover;
  1670.                         if (xHover)
  1671.                         {
  1672.                             g.DrawString("r", new Font("Marlett", 9f), new SolidBrush(Helpers.FromHex("#596372")), (float)(this.Width - 18), 4f);
  1673.                         }
  1674.                         else
  1675.                         {
  1676.                             g.DrawString("r", new Font("Marlett", 9f), new SolidBrush(Helpers.FromHex("#435363")), (float)(this.Width - 18), 4f);
  1677.                         }
  1678.                     }
  1679.                     g.DrawRectangle(new Pen(this._border), 0, 0, this.Width - 1, this.Height - 1);
  1680.                     g.FillRectangle(new SolidBrush(this._border), 0, 0, 6, this.Height);
  1681.                 }
  1682.             }
  1683.  
  1684.             protected override void OnMouseMove(MouseEventArgs e)
  1685.             {
  1686.                 base.OnMouseMove(e);
  1687.                 bool exitButton = this._exitButton;
  1688.                 if (exitButton)
  1689.                 {
  1690.                     Rectangle rectangle = new Rectangle(checked(this.Width - 16), 4, 12, 13);
  1691.                     Rectangle rectangle2 = rectangle;
  1692.                     bool flag = rectangle2.Contains(e.X, e.Y);
  1693.                     if (flag)
  1694.                     {
  1695.                         this._xHover = true;
  1696.                         flag = this._xChangeCursor;
  1697.                         if (flag)
  1698.                         {
  1699.                             this.Cursor = Cursors.Hand;
  1700.                         }
  1701.                     }
  1702.                     else
  1703.                     {
  1704.                         this._xHover = false;
  1705.                         this.Cursor = Cursors.Default;
  1706.                     }
  1707.                 }
  1708.                 this.Invalidate();
  1709.             }
  1710.  
  1711.             protected override void OnMouseUp(MouseEventArgs e)
  1712.             {
  1713.                 base.OnMouseUp(e);
  1714.                 bool exitButton = this._exitButton;
  1715.                 if (exitButton)
  1716.                 {
  1717.                     bool flag = this._xHover;
  1718.                     if (flag)
  1719.                     {
  1720.                         VelocityAlert.XClickedEventHandler xClickedEvent = this.XClickedEvent;
  1721.                         flag = (xClickedEvent != null);
  1722.                         if (flag)
  1723.                         {
  1724.                             xClickedEvent(this, EventArgs.Empty);
  1725.                         }
  1726.                     }
  1727.                 }
  1728.             }
  1729.  
  1730.             protected override void OnTextChanged(EventArgs e)
  1731.             {
  1732.                 base.OnTextChanged(e);
  1733.                 this.Invalidate();
  1734.             }
  1735.  
  1736.             private static List<WeakReference> __ENCList = new List<WeakReference>();
  1737.  
  1738.             private VelocityAlert.XClickedEventHandler XClickedEvent;
  1739.  
  1740.             private bool _xHover;
  1741.  
  1742.             private string FillerImage;
  1743.  
  1744.             private bool _xChangeCursor;
  1745.  
  1746.             private string _title;
  1747.  
  1748.             private bool _exitButton;
  1749.  
  1750.             private bool _showImage;
  1751.  
  1752.             private Image _image;
  1753.  
  1754.             private Color _border;
  1755.  
  1756.             public delegate void XClickedEventHandler(object sender, EventArgs e);
  1757.         }
  1758.         public sealed class Helpers
  1759.         {
  1760.             public static Image b64Image(string b64)
  1761.             {
  1762.                 return Image.FromStream(new MemoryStream(Convert.FromBase64String(b64)));
  1763.             }
  1764.  
  1765.             public static Color FromHex(string hex)
  1766.             {
  1767.                 return ColorTranslator.FromHtml(hex);
  1768.             }
  1769.  
  1770.             public enum MouseState
  1771.             {
  1772.                 Hover = 1,
  1773.                 Down,
  1774.                 None
  1775.             }
  1776.  
  1777.             public enum TxtAlign
  1778.             {
  1779.                 Left = 1,
  1780.                 Center,
  1781.                 Right
  1782.             }
  1783.         }
  1784.     }
  1785. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement