THE_LORD

Youtube Theme

Jun 19th, 2017
545
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 75.18 KB | None | 0 0
  1. #region NameSpaces
  2.  
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Text;
  6. using System.Drawing.Drawing2D;
  7. using System.ComponentModel;
  8. using System.Diagnostics;
  9. using System.Drawing;
  10. using System.Drawing.Imaging;
  11. using System.Drawing.Text;
  12. using System.Reflection;
  13. using System.Runtime.CompilerServices;
  14. using System.Runtime.InteropServices;
  15. using System.Windows.Forms;
  16. using Microsoft.VisualBasic;
  17. using System.Windows;
  18. using static HelperMethods;
  19.  
  20. #endregion
  21.  
  22. /// <summary>
  23. /// Youtube Theme
  24. /// Author : THE LORD
  25. /// Release Date : Monday, June 19, 2017
  26. /// Updated : Wednesday, June 21, 2017
  27. /// HF Account : https://hackforums.net/member.php?action=profile&uid=3304362
  28. /// PM Me for any bug.
  29. /// </summary>
  30.  
  31. #region Helper
  32.  
  33. public sealed class HelperMethods
  34. {
  35.  
  36.     #region MouseStates
  37.  
  38.     /// <summary>
  39.     /// The helper enumerator to get mouse states.
  40.     /// </summary>
  41.     public enum MouseMode : byte
  42.     {
  43.         Normal,
  44.         Hovered,
  45.         Pushed,
  46.         Disabled
  47.     }
  48.  
  49.     #endregion
  50.  
  51.     #region Draw Methods
  52.  
  53.     /// <summary>
  54.     /// The Method to draw the image from encoded base64 string.
  55.     /// </summary>
  56.     /// <param name="G">The Graphics to draw the image.</param>
  57.     /// <param name="Base64Image">The Encoded base64 image.</param>
  58.     /// <param name="Rect">The Rectangle area for the image.</param>
  59.     public void DrawImageFromBase64(Graphics G, string Base64Image, Rectangle Rect)
  60.     {
  61.         Image IM = null;
  62.         using (System.IO.MemoryStream ms = new System.IO.MemoryStream(Convert.FromBase64String(Base64Image)))
  63.         {
  64.             IM = Image.FromStream(ms);
  65.             ms.Close();
  66.         }
  67.         G.DrawImage(IM, Rect);
  68.     }
  69.  
  70.     /// <summary>
  71.     /// The Method to fill rounded rectangle.
  72.     /// </summary>
  73.     /// <param name="G">The Graphics to draw the image.</param>
  74.     /// <param name="C">The Color to the rectangle area.</param>
  75.     /// <param name="Rect">The Rectangle area to be filled.</param>
  76.     /// <param name="Curve">The Rounding border radius.</param>
  77.     /// <param name="TopLeft">Wether the top left of rectangle be round or not.</param>
  78.     /// <param name="TopRight">Wether the top right of rectangle be round or not.</param>
  79.     /// <param name="BottomLeft">Wether the bottom left of rectangle be round or not.</param>
  80.     /// <param name="BottomRight">Wether the bottom right of rectangle be round or not.</param>
  81.     public void FillRoundedPath(Graphics G, Color C, Rectangle Rect, int Curve, bool TopLeft = true,
  82.         bool TopRight = true, bool BottomLeft = true, bool BottomRight = true)
  83.     {
  84.         G.FillPath(new SolidBrush(C), RoundRec(Rect, Curve, TopLeft, TopRight, BottomLeft, BottomRight));
  85.     }
  86.  
  87.     /// <summary>
  88.     /// The Method to fill the rounded rectangle.
  89.     /// </summary>
  90.     /// <param name="G">The Graphics to fill the rectangle.</param>
  91.     /// <param name="B">The brush to the rectangle area.</param>
  92.     /// <param name="Rect">The Rectangle area to be filled.</param>
  93.     /// <param name="Curve">The Rounding border radius.</param>
  94.     /// <param name="TopLeft">Wether the top left of rectangle be round or not.</param>
  95.     /// <param name="TopRight">Wether the top right of rectangle be round or not.</param>
  96.     /// <param name="BottomLeft">Wether the bottom left of rectangle be round or not.</param>
  97.     /// <param name="BottomRight">Wether the bottom right of rectangle be round or not.</param>
  98.     public void FillRoundedPath(Graphics G, Brush B, Rectangle Rect, int Curve, bool TopLeft = true,
  99.         bool TopRight = true, bool BottomLeft = true, bool BottomRight = true)
  100.     {
  101.         G.FillPath(B, RoundRec(Rect, Curve, TopLeft, TopRight, BottomLeft, BottomRight));
  102.     }
  103.  
  104.     /// <summary>
  105.     /// The Method to fill the rectangle the base color and surrounding with another color(Rectangle with shadow).
  106.     /// </summary>
  107.     /// <param name="G">The Graphics to fill the rectangle.</param>
  108.     /// <param name="CenterColor">The Center color of the rectangle area.</param>
  109.     /// <param name="SurroundColor">The Inner Surround color of the rectangle area.</param>
  110.     /// <param name="P">The Point of the surrounding color.</param>
  111.     /// <param name="Rect">The Rectangle area to be filled.</param>
  112.     /// <param name="Curve">The Rounding border radius.</param>
  113.     /// <param name="TopLeft">Wether the top left of rectangle be round or not.</param>
  114.     /// <param name="TopRight">Wether the top right of rectangle be round or not.</param>
  115.     /// <param name="BottomLeft">Wether the bottom left of rectangle be round or not.</param>
  116.     /// <param name="BottomRight">Wether the bottom right of rectangle be round or not.</param>
  117.     public void FillWithInnerRectangle(Graphics G, Color CenterColor, Color SurroundColor, Point P, Rectangle Rect,
  118.         int Curve, bool TopLeft = true, bool TopRight = true, bool BottomLeft = true, bool BottomRight = true)
  119.     {
  120.         using (
  121.             PathGradientBrush PGB =
  122.                 new PathGradientBrush(RoundRec(Rect, Curve, TopLeft, TopRight, BottomLeft, BottomRight)))
  123.         {
  124.  
  125.             PGB.CenterColor = CenterColor;
  126.             PGB.SurroundColors = new Color[] { SurroundColor };
  127.             PGB.FocusScales = P;
  128.             GraphicsPath GP = new GraphicsPath { FillMode = FillMode.Winding };
  129.             GP.AddRectangle(Rect);
  130.             G.FillPath(PGB, GP);
  131.             GP.Dispose();
  132.         }
  133.     }
  134.  
  135.     /// <summary>
  136.     /// The Method to fill the circle the base color and surrounding with another color(Rectangle with shadow).
  137.     /// </summary>
  138.     /// <param name="G">The Graphics to fill the circle.</param>
  139.     /// <param name="CenterColor">The Center color of the rectangle area.</param>
  140.     /// <param name="SurroundColor">The Inner Surround color of the rectangle area.</param>
  141.     /// <param name="P">The Point of the surrounding color.</param>
  142.     /// <param name="Rect">The circle area to be filled.</param>
  143.     public void FillWithInnerEllipse(Graphics G, Color CenterColor, Color SurroundColor, Point P, Rectangle Rect)
  144.     {
  145.         GraphicsPath GP = new GraphicsPath { FillMode = FillMode.Winding };
  146.         GP.AddEllipse(Rect);
  147.         using (PathGradientBrush PGB = new PathGradientBrush(GP))
  148.         {
  149.             PGB.CenterColor = CenterColor;
  150.             PGB.SurroundColors = new Color[] { SurroundColor };
  151.             PGB.FocusScales = P;
  152.             G.FillPath(PGB, GP);
  153.             GP.Dispose();
  154.         }
  155.     }
  156.  
  157.     /// <summary>
  158.     /// The Method to fill the rounded rectangle the base color and surrounding with another color(Rectangle with shadow).
  159.     /// </summary>
  160.     /// <param name="G">The Graphics to fill rounded the rectangle.</param>
  161.     /// <param name="CenterColor">The Center color of the rectangle area.</param>
  162.     /// <param name="SurroundColor">The Inner Surround color of the rectangle area.</param>
  163.     /// <param name="P">The Point of the surrounding color.</param>
  164.     /// <param name="Rect">The Rectangle area to be filled.</param>
  165.     /// <param name="Curve">The Rounding border radius.</param>
  166.     /// <param name="TopLeft">Wether the top left of rectangle be round or not.</param>
  167.     /// <param name="TopRight">Wether the top right of rectangle be round or not.</param>
  168.     /// <param name="BottomLeft">Wether the bottom left of rectangle be round or not.</param>
  169.     /// <param name="BottomRight">Wether the bottom right of rectangle be round or not.</param>
  170.     public void FillWithInnerRoundedPath(Graphics G, Color CenterColor, Color SurroundColor, Point P, Rectangle Rect,
  171.         int Curve, bool TopLeft = true, bool TopRight = true, bool BottomLeft = true, bool BottomRight = true)
  172.     {
  173.         using (
  174.             PathGradientBrush PGB =
  175.                 new PathGradientBrush(RoundRec(Rect, Curve, TopLeft, TopRight, BottomLeft, BottomRight)))
  176.         {
  177.             PGB.CenterColor = CenterColor;
  178.             PGB.SurroundColors = new Color[] { SurroundColor };
  179.             PGB.FocusScales = P;
  180.             G.FillPath(PGB, RoundRec(Rect, Curve, TopLeft, TopRight, BottomLeft, BottomRight));
  181.         }
  182.     }
  183.  
  184.     /// <summary>
  185.     /// The Method to draw the rounded rectangle area.
  186.     /// </summary>
  187.     /// <param name="G">The Graphics to draw rounded the rectangle.</param>
  188.     /// <param name="C">Border Color</param>
  189.     /// <param name="Size">Border thickness</param>
  190.     /// <param name="Rect">The Rectangle area to be drawn.</param>
  191.     /// <param name="Curve">The Rounding border radius.</param>
  192.     /// <param name="TopLeft">Wether the top left of rectangle be round or not.</param>
  193.     /// <param name="TopRight">Wether the top right of rectangle be round or not.</param>
  194.     /// <param name="BottomLeft">Wether the bottom left of rectangle be round or not.</param>
  195.     /// <param name="BottomRight">Wether the bottom right of rectangle be round or not.</param>
  196.     public void DrawRoundedPath(Graphics G, Color C, float Size, Rectangle Rect, int Curve, bool TopLeft = true,
  197.         bool TopRight = true, bool BottomLeft = true, bool BottomRight = true)
  198.     {
  199.         G.DrawPath(new Pen(C, Size), RoundRec(Rect, Curve, TopLeft, TopRight, BottomLeft, BottomRight));
  200.     }
  201.  
  202.     /// <summary>
  203.     /// The method to draw the triangle.
  204.     /// </summary>
  205.     /// <param name="G">The Graphics to draw triangle.</param>
  206.     /// <param name="C">The Triangle Color.</param>
  207.     /// <param name="Size">The Triangle thickness</param>
  208.     /// <param name="P1">Point 1</param>
  209.     /// <param name="P2">Point 2</param>
  210.     /// <param name="P3">Point 3</param>
  211.     /// <param name="P4">Point 4</param>
  212.     /// <param name="P5">Point 5</param>
  213.     /// <param name="P6">Point 6</param>
  214.     public void DrawTriangle(Graphics G, Color C, int Size, Point P1_0, Point P1_1, Point P2_0, Point P2_1, Point P3_0,
  215.         Point P3_1)
  216.     {
  217.         G.DrawLine(new Pen(C, Size), P1_0, P1_1);
  218.         G.DrawLine(new Pen(C, Size), P2_0, P2_1);
  219.         G.DrawLine(new Pen(C, Size), P3_0, P3_1);
  220.     }
  221.  
  222.     /// <summary>
  223.     /// The Method to fill the rectangle with border.
  224.     /// </summary>
  225.     /// <param name="G">The Graphics to fill the the rectangle.</param>
  226.     /// <param name="Rect">The Rectangle to fill.</param>
  227.     /// <param name="RectColor">The Rectangle color.</param>
  228.     /// <param name="StrokeColor">The Stroke(Border) color.</param>
  229.     /// <param name="StrokeSize">The Stroke thickness.</param>
  230.     public void FillStrokedRectangle(Graphics G, Rectangle Rect, Color RectColor, Color Stroke, int StrokeSize = 1)
  231.     {
  232.         using (SolidBrush B = new SolidBrush(RectColor))
  233.         using (Pen S = new Pen(Stroke, StrokeSize))
  234.         {
  235.             G.FillRectangle(B, Rect);
  236.             G.DrawRectangle(S, Rect);
  237.         }
  238.  
  239.     }
  240.  
  241.     /// <summary>
  242.     /// The Method to fill rounded rectangle with border.
  243.     /// </summary>
  244.     /// <param name="G">The Graphics to fill rounded the rectangle.</param>
  245.     /// <param name="Rect">The Rectangle to fill.</param>
  246.     /// <param name="RectColor">The Rectangle color.</param>
  247.     /// <param name="StrokeColor">The Stroke(Border) color.</param>
  248.     /// <param name="StrokeSize">The Stroke thickness.</param>
  249.     /// <param name="Curve">The Rounding border radius.</param>
  250.     /// <param name="TopLeft">Wether the top left of rectangle be round or not.</param>
  251.     /// <param name="TopRight">Wether the top right of rectangle be round or not.</param>
  252.     /// <param name="BottomLeft">Wether the bottom left of rectangle be round or not.</param>
  253.     /// <param name="BottomRight">Wether the bottom right of rectangle be round or not.</param>
  254.     public void FillRoundedStrokedRectangle(Graphics G, Rectangle Rect, Color RectColor, Color Stroke,
  255.         int StrokeSize = 1, int curve = 1, bool TopLeft = true, bool TopRight = true, bool BottomLeft = true,
  256.         bool BottomRight = true)
  257.     {
  258.         using (SolidBrush B = new SolidBrush(RectColor))
  259.         {
  260.             using (Pen S = new Pen(Stroke, StrokeSize))
  261.             {
  262.                 FillRoundedPath(G, B, Rect, curve, TopLeft, TopRight, BottomLeft, BottomRight);
  263.                 DrawRoundedPath(G, Stroke, StrokeSize, Rect, curve, TopLeft, TopRight, BottomLeft, BottomRight);
  264.             }
  265.         }
  266.     }
  267.  
  268.     /// <summary>
  269.     /// The Method to draw the image with custom color.
  270.     /// </summary>
  271.     /// <param name="G"> The Graphic to draw the image.</param>
  272.     /// <param name="R"> The Rectangle area of image.</param>
  273.     /// <param name="_Image"> The image that the custom color applies on it.</param>
  274.     /// <param name="C">The Color that be applied to the image.</param>
  275.     /// <remarks></remarks>
  276.     public void DrawImageWithColor(Graphics G, Rectangle R, Image _Image, Color C)
  277.     {
  278.         float[][] ptsArray = new float[][]
  279.         {
  280.             new float[] {Convert.ToSingle(C.R / 255.0), 0f, 0f, 0f, 0f},
  281.             new float[] {0f, Convert.ToSingle(C.G / 255.0), 0f, 0f, 0f},
  282.             new float[] {0f, 0f, Convert.ToSingle(C.B / 255.0), 0f, 0f},
  283.             new float[] {0f, 0f, 0f, Convert.ToSingle(C.A / 255.0), 0f},
  284.             new float[]
  285.             {
  286.                 Convert.ToSingle( C.R/255.0),
  287.                 Convert.ToSingle( C.G/255.0),
  288.                 Convert.ToSingle( C.B/255.0), 0f,
  289.                 Convert.ToSingle( C.A/255.0)
  290.             }
  291.         };
  292.         ImageAttributes imgAttribs = new ImageAttributes();
  293.         imgAttribs.SetColorMatrix(new ColorMatrix(ptsArray), ColorMatrixFlag.Default, ColorAdjustType.Default);
  294.         G.DrawImage(_Image, R, 0, 0, _Image.Width, _Image.Height, GraphicsUnit.Pixel, imgAttribs);
  295.         _Image.Dispose();
  296.     }
  297.  
  298.  
  299.     /// <summary>
  300.     /// The Method to draw the image with custom color.
  301.     /// </summary>
  302.     /// <param name="G"> The Graphic to draw the image.</param>
  303.     /// <param name="R"> The Rectangle area of image.</param>
  304.     /// <param name="_Image"> The Encoded base64 image that the custom color applies on it.</param>
  305.     /// <param name="C">The Color that be applied to the image.</param>
  306.     /// <remarks></remarks>
  307.     public void DrawImageWithColor(Graphics G, Rectangle R, string _Image, Color C)
  308.     {
  309.         Image IM = ImageFromBase64(_Image);
  310.         float[][] ptsArray = new float[][]
  311.         {
  312.             new float[] {Convert.ToSingle(C.R / 255.0), 0f, 0f, 0f, 0f},
  313.             new float[] {0f, Convert.ToSingle(C.G / 255.0), 0f, 0f, 0f},
  314.             new float[] {0f, 0f, Convert.ToSingle(C.B / 255.0), 0f, 0f},
  315.             new float[] {0f, 0f, 0f, Convert.ToSingle(C.A / 255.0), 0f},
  316.             new float[]
  317.             {
  318.                 Convert.ToSingle( C.R/255.0),
  319.                 Convert.ToSingle( C.G/255.0),
  320.                 Convert.ToSingle( C.B/255.0), 0f,
  321.                 Convert.ToSingle( C.A/255.0)
  322.             }
  323.         };
  324.         ImageAttributes imgAttribs = new ImageAttributes();
  325.         imgAttribs.SetColorMatrix(new ColorMatrix(ptsArray), ColorMatrixFlag.Default, ColorAdjustType.Default);
  326.         G.DrawImage(IM, R, 0, 0, IM.Width, IM.Height, GraphicsUnit.Pixel, imgAttribs);
  327.     }
  328.  
  329.     #endregion
  330.  
  331.     #region Shapes
  332.  
  333.     /// <summary>
  334.     /// The Triangle that joins 3 points to the triangle shape.
  335.     /// </summary>
  336.     /// <param name="P1">Point 1.</param>
  337.     /// <param name="P2">Point 2.</param>
  338.     /// <param name="P3">Point 3.</param>
  339.     /// <returns>The Trangle shape based on given points.</returns>
  340.     public Point[] Triangle(Point P1, Point P2, Point P3)
  341.     {
  342.         return new Point[] {
  343.             P1,
  344.             P2,
  345.             P3
  346.         };
  347.     }
  348.  
  349.     #endregion
  350.  
  351.     #region Brushes
  352.  
  353.     /// <summary>
  354.     /// The Brush with two colors one center another surounding the center based on the given rectangle area.
  355.     /// </summary>
  356.     /// <param name="CenterColor">The Center color of the rectangle.</param>
  357.     /// <param name="SurroundColor">The Surrounding color of the rectangle.</param>
  358.     /// <param name="P">The Point of surrounding.</param>
  359.     /// <param name="Rect">The Rectangle of the brush.</param>
  360.     /// <returns>The Brush with two colors one center another surounding the center.</returns>
  361.     public static PathGradientBrush GlowBrush(Color CenterColor, Color SurroundColor, Point P, Rectangle Rect)
  362.     {
  363.         GraphicsPath GP = new GraphicsPath { FillMode = FillMode.Winding };
  364.         GP.AddRectangle(Rect);
  365.         return new PathGradientBrush(GP)
  366.         {
  367.             CenterColor = CenterColor,
  368.             SurroundColors = new Color[] { SurroundColor },
  369.             FocusScales = P
  370.         };
  371.     }
  372.  
  373.     /// <summary>
  374.     /// The Brush from RGBA color.
  375.     /// </summary>
  376.     /// <param name="R">Red.</param>
  377.     /// <param name="G">Green.</param>
  378.     /// <param name="B">Blue.</param>
  379.     /// <param name="A">Alpha.</param>
  380.     /// <returns>The Brush from given RGBA color.</returns>
  381.     public SolidBrush SolidBrushRGBColor(int R, int G, int B, int A = 0)
  382.     {
  383.         return new SolidBrush(Color.FromArgb(A, R, G, B));
  384.     }
  385.  
  386.     /// <summary>
  387.     /// The Brush from HEX color.
  388.     /// </summary>
  389.     /// <param name="C_WithoutHash">HEX Color without hash.</param>
  390.     /// <returns>The Brush from given HEX color.</returns>
  391.     public SolidBrush SolidBrushHTMlColor(string C_WithoutHash)
  392.     {
  393.         return new SolidBrush(GetHTMLColor(C_WithoutHash));
  394.     }
  395.  
  396.     #endregion
  397.  
  398.     #region Pens
  399.  
  400.     /// <summary>
  401.     /// The Pen from RGBA color.
  402.     /// </summary>
  403.     /// <param name="R">Red.</param>
  404.     /// <param name="G">Green.</param>
  405.     /// <param name="B">Blue.</param>
  406.     /// <param name="A">Alpha.</param>
  407.     /// <returns>The Pen from given RGBA color.</returns>
  408.     public Pen PenRGBColor(int R, int G, int B, int A, float Size)
  409.     {
  410.         return new Pen(Color.FromArgb(A, R, G, B), Size);
  411.     }
  412.  
  413.     /// <summary>
  414.     /// The Pen from HEX color.
  415.     /// </summary>
  416.     /// <param name="C_WithoutHash">HEX Color without hash.</param>
  417.     /// <param name="Size">The Size of the pen.</param>
  418.     /// <returns></returns>
  419.     public Pen PenHTMlColor(string C_WithoutHash, float Size = 1)
  420.     {
  421.         return new Pen(GetHTMLColor(C_WithoutHash), Size);
  422.     }
  423.  
  424.     #endregion
  425.  
  426.     #region Colors
  427.  
  428.     /// <summary>
  429.     ///
  430.     /// </summary>
  431.     /// <param name="C_WithoutHash"></param>
  432.     /// <returns></returns>
  433.     public Color GetHTMLColor(string C_WithoutHash)
  434.     {
  435.         return ColorTranslator.FromHtml("#" + C_WithoutHash);
  436.     }
  437.  
  438.     /// <summary>
  439.     /// The Color from HEX by alpha property.
  440.     /// </summary>
  441.     /// <param name="alpha">Alpha.</param>
  442.     /// <param name="C_WithoutHash">HEX Color without hash.</param>
  443.     /// <returns>The Color from HEX with given ammount of transparency</returns>
  444.     public Color GetAlphaHTMLColor(int alpha, string C_WithoutHash)
  445.     {
  446.         return Color.FromArgb(alpha, ColorTranslator.FromHtml("#" + C_WithoutHash));
  447.     }
  448.  
  449.     #endregion
  450.  
  451.     #region Methods
  452.  
  453.     /// <summary>
  454.     /// The String format to provide the alignment.
  455.     /// </summary>
  456.     /// <param name="Horizontal">Horizontal alignment.</param>
  457.     /// <param name="Vertical">Horizontal alignment. alignment.</param>
  458.     /// <returns>The String format.</returns>
  459.     public StringFormat SetPosition(StringAlignment Horizontal = StringAlignment.Center, StringAlignment Vertical = StringAlignment.Center)
  460.     {
  461.         return new StringFormat
  462.         {
  463.             Alignment = Horizontal,
  464.             LineAlignment = Vertical
  465.         };
  466.     }
  467.  
  468.     /// <summary>
  469.     /// The Matrix array of single from color.
  470.     /// </summary>
  471.     /// <param name="C">The Color.</param>
  472.     /// <returns>The Matrix array of single from the given color</returns>
  473.     public float[][] ColorToMatrix(Color C)
  474.     {
  475.         return new float[][] {
  476.             new float[] {
  477.                 Convert.ToSingle(C.R / 255),
  478.                 0,
  479.                 0,
  480.                 0,
  481.                 0
  482.             },
  483.             new float[] {
  484.                 0,
  485.                 Convert.ToSingle(C.G / 255),
  486.                 0,
  487.                 0,
  488.                 0
  489.             },
  490.             new float[] {
  491.                 0,
  492.                 0,
  493.                 Convert.ToSingle(C.B / 255),
  494.                 0,
  495.                 0
  496.             },
  497.             new float[] {
  498.                 0,
  499.                 0,
  500.                 0,
  501.                 Convert.ToSingle(C.A / 255),
  502.                 0
  503.             },
  504.             new float[] {
  505.                 Convert.ToSingle(C.R / 255),
  506.                 Convert.ToSingle(C.G / 255),
  507.                 Convert.ToSingle(C.B / 255),
  508.                 0f,
  509.                 Convert.ToSingle(C.A / 255)
  510.             }
  511.         };
  512.     }
  513.  
  514.     /// <summary>
  515.     /// The Image from encoded base64 image.
  516.     /// </summary>
  517.     /// <param name="Base64Image">The Encoded base64 image</param>
  518.     /// <returns>The Image from encoded base64.</returns>
  519.     public Image ImageFromBase64(string Base64Image)
  520.     {
  521.         using (System.IO.MemoryStream ms = new System.IO.MemoryStream(Convert.FromBase64String(Base64Image)))
  522.         {
  523.             return Image.FromStream(ms);
  524.         }
  525.     }
  526.  
  527.  
  528.     #endregion
  529.  
  530.     #region Round Border
  531.  
  532.     /// <summary>
  533.     /// Credits : AeonHack
  534.     /// </summary>
  535.  
  536.     public GraphicsPath RoundRec(Rectangle r, int Curve, bool TopLeft = true, bool TopRight = true,
  537.       bool BottomLeft = true, bool BottomRight = true)
  538.     {
  539.         GraphicsPath CreateRoundPath = new GraphicsPath(FillMode.Winding);
  540.         if (TopLeft)
  541.         {
  542.             CreateRoundPath.AddArc(r.X, r.Y, Curve, Curve, 180f, 90f);
  543.         }
  544.         else
  545.         {
  546.             CreateRoundPath.AddLine(r.X, r.Y, r.X, r.Y);
  547.         }
  548.         if (TopRight)
  549.         {
  550.             CreateRoundPath.AddArc(r.Right - Curve, r.Y, Curve, Curve, 270f, 90f);
  551.         }
  552.         else
  553.         {
  554.             CreateRoundPath.AddLine(r.Right - r.Width, r.Y, r.Width, r.Y);
  555.         }
  556.         if (BottomRight)
  557.         {
  558.             CreateRoundPath.AddArc(r.Right - Curve, r.Bottom - Curve, Curve, Curve, 0f, 90f);
  559.         }
  560.         else
  561.         {
  562.             CreateRoundPath.AddLine(r.Right, r.Bottom, r.Right, r.Bottom);
  563.  
  564.         }
  565.         if (BottomLeft)
  566.         {
  567.             CreateRoundPath.AddArc(r.X, (r.Bottom + r.Y) - Curve, Curve, Curve, 90f, 90f);
  568.         }
  569.         else
  570.         {
  571.             CreateRoundPath.AddLine(r.X, r.Bottom, r.X, r.Bottom);
  572.         }
  573.         CreateRoundPath.CloseFigure();
  574.         return CreateRoundPath;
  575.     }
  576.  
  577.     #endregion
  578.  
  579. }
  580.  
  581. #endregion
  582.  
  583. #region  TabControl
  584.  
  585. public class YoutubeTabControl : TabControl
  586. {
  587.  
  588.     #region  Declarations
  589.  
  590.     private static readonly HelperMethods H = new HelperMethods();
  591.     private Rectangle R;
  592.     private Point _LocatedPostion;
  593.     private Point _ImageLocation;
  594.     private Point _TextLocation;
  595.     private Point _HeaderTextLocation;
  596.  
  597.     #endregion
  598.  
  599.     #region  Constructors
  600.  
  601.     public YoutubeTabControl()
  602.     {
  603.         SetStyle(ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.SupportsTransparentBackColor, true);
  604.         DoubleBuffered = true;
  605.         UpdateStyles();
  606.         SizeMode = TabSizeMode.Fixed;
  607.         Dock = DockStyle.None;
  608.         ItemSize = new Size(38, 180);
  609.         Alignment = TabAlignment.Left;
  610.         Font = new Font("Myriad Pro", 9);
  611.         _LocatedPostion = new Point(-1, -1);
  612.         _ImageLocation = new Point(30, 13);
  613.         _TextLocation = new Point(50, 2);
  614.         _HeaderTextLocation = new Point(16, 5);
  615.     }
  616.  
  617.     #endregion
  618.  
  619.     #region  Events
  620.  
  621.     protected override void OnCreateControl()
  622.     {
  623.         foreach (TabPage Tab in TabPages)
  624.         {
  625.             Tab.BackColor = Colors.LightSilver;
  626.             Invalidate();
  627.         }
  628.         base.OnCreateControl();
  629.     }
  630.  
  631.     protected override void OnMouseMove(MouseEventArgs e)
  632.     {
  633.         if (DesignMode)
  634.             return;
  635.         _LocatedPostion = e.Location;
  636.         Cursor = Cursors.Hand;
  637.         Invalidate();
  638.         base.OnMouseMove(e);
  639.     }
  640.  
  641.     protected override void OnMouseLeave(EventArgs e)
  642.     {
  643.         _LocatedPostion = new Point(-1, -1);
  644.         Cursor = Cursors.Default;
  645.         Invalidate();
  646.         base.OnMouseLeave(e);
  647.     }
  648.  
  649.     #endregion
  650.  
  651.     #region  Properties
  652.  
  653.     [Category("Custom"), Description("Gets or sets the tab pages image location.")]
  654.     public Point ImageLocation
  655.     {
  656.         get { return _ImageLocation; }
  657.         set
  658.         {
  659.             _ImageLocation = value;
  660.             Invalidate();
  661.         }
  662.     }
  663.  
  664.     [Category("Custom"), Description("Gets or sets the tab pages text location.")]
  665.     public Point TextLocation
  666.     {
  667.         get { return _TextLocation; }
  668.         set
  669.         {
  670.             _TextLocation = value;
  671.             Invalidate();
  672.         }
  673.     }
  674.  
  675.     [Category("Custom"), Description("Gets or sets the tab pages header text location.")]
  676.     public Point HeaderTextLocation
  677.     {
  678.         get { return _HeaderTextLocation; }
  679.         set
  680.         {
  681.             _HeaderTextLocation = value;
  682.             Invalidate();
  683.         }
  684.     }
  685.  
  686.     #endregion
  687.  
  688.     #region  Draw Control
  689.  
  690.     protected override void OnPaint(PaintEventArgs e)
  691.     {
  692.         Graphics G = e.Graphics;
  693.         G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
  694.         G.InterpolationMode = InterpolationMode.HighQualityBicubic;
  695.  
  696.         G.FillRectangle(Brushes.White, new Rectangle(0, 0, ItemSize.Height, Height));
  697.         G.FillRectangle(Brushes.LightSilver, new Rectangle(ItemSize.Height, 0, Width, Height));
  698.         using (StringFormat SF = new StringFormat { LineAlignment = StringAlignment.Center })
  699.         {
  700.             for (int i = 0; i <= TabCount - 1; i++)
  701.             {
  702.                 R = GetTabRect(i);
  703.  
  704.                 if (TabPages[i].Tag != null)
  705.                 {
  706.                     using (Font F = new Font(Font.Name, 9, FontStyle.Bold))
  707.                     {
  708.  
  709.                         G.DrawString(TabPages[i].Text.ToUpper(), F, Brushes.Red, new Rectangle(R.X + HeaderTextLocation.X, R.Y + HeaderTextLocation.Y, R.Width - 2, R.Height), SF);
  710.  
  711.                     }
  712.  
  713.                 }
  714.                 else if (i == SelectedIndex)
  715.                 {
  716.                     G.FillRectangle(Brushes.Red, new Rectangle(R.X - 2, R.Y + 2, R.Width - 1, R.Height - 2));
  717.  
  718.                     G.DrawString(TabPages[i].Text, Font, Brushes.White, new Rectangle(R.X + TextLocation.X, R.Y + TextLocation.Y, R.Width - 2, R.Height), SF);                    
  719.                 }
  720.                 else
  721.                 {
  722.  
  723.                     if (R.Contains(_LocatedPostion))
  724.                     {
  725.                         G.FillRectangle(Brushes.Gray, new Rectangle(R.X - 2, R.Y + 2, R.Width - 1, R.Height - 2));
  726.  
  727.                         G.DrawString(TabPages[i].Text, Font, Brushes.White, new Rectangle(R.X + TextLocation.X, R.Y + TextLocation.Y, R.Width - 2, R.Height), SF);
  728.                        
  729.                     }
  730.                     else
  731.                     {
  732.                         G.DrawString(TabPages[i].Text, Font, Brushes.Gray, new Rectangle(R.X + TextLocation.X, R.Y + TextLocation.Y, R.Width - 2, R.Height), SF);
  733.  
  734.                     }
  735.  
  736.                 }
  737.  
  738.                 if ((ImageList != null) && ImageList.Images[i] != null && TabPages[i].Tag == null)
  739.                 {
  740.                     H.DrawImageWithColor(G, new Rectangle(R.X + ImageLocation.X, R.Y + ImageLocation.Y, 13, 13), ImageList.Images[i], i == SelectedIndex || R.Contains(_LocatedPostion) ? Colors.White : Colors.Gray);
  741.                 }
  742.  
  743.             }
  744.  
  745.         }
  746.  
  747.     }
  748.  
  749.     #endregion
  750.  
  751. }
  752.  
  753. public class YoutubeHorizontalTabControl : TabControl
  754. {
  755.  
  756.     #region  Declarations
  757.  
  758.     private static readonly HelperMethods H = new HelperMethods();
  759.     private Point _LocatedPostion;
  760.     private Rectangle R;
  761.  
  762.     #endregion
  763.  
  764.     #region  Constructors
  765.  
  766.     public YoutubeHorizontalTabControl()
  767.     {
  768.         SetStyle(ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.SupportsTransparentBackColor, true);
  769.         DoubleBuffered = true;
  770.         UpdateStyles();
  771.         SizeMode = TabSizeMode.Fixed;
  772.         Dock = DockStyle.None;
  773.         ItemSize = new Size(90, 48);
  774.         Alignment = TabAlignment.Top;
  775.         Font = new Font("Myriad Pro", 9);
  776.         _LocatedPostion = new Point(-1, -1);
  777.     }
  778.  
  779.     #endregion
  780.  
  781.     #region  Events
  782.  
  783.     protected override void OnCreateControl()
  784.     {
  785.         foreach (TabPage Tab in TabPages)
  786.         {
  787.             Tab.BackColor = Colors.White;
  788.             Invalidate();
  789.         }
  790.         base.OnCreateControl();
  791.     }
  792.  
  793.     protected override void OnMouseMove(MouseEventArgs e)
  794.     {
  795.         if (DesignMode)
  796.             return;
  797.         _LocatedPostion = e.Location;
  798.         Cursor = Cursors.Hand;
  799.         Invalidate();
  800.         base.OnMouseMove(e);
  801.     }
  802.  
  803.     protected override void OnMouseLeave(EventArgs e)
  804.     {
  805.         _LocatedPostion = new Point(-1, -1);
  806.         Cursor = Cursors.Default;
  807.         Invalidate();
  808.         base.OnMouseLeave(e);
  809.     }
  810.  
  811.     #endregion
  812.  
  813.     #region  Properties
  814.  
  815.     #endregion
  816.  
  817.     #region  Draw Control
  818.  
  819.     protected override void OnPaint(PaintEventArgs e)
  820.     {
  821.         Graphics G = e.Graphics;
  822.         G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
  823.         G.InterpolationMode = InterpolationMode.HighQualityBilinear;
  824.         G.CompositingQuality = CompositingQuality.HighQuality;
  825.  
  826.         G.FillRectangle(Brushes.White, new Rectangle(0, 0, Width, ItemSize.Height));
  827.         G.FillRectangle(Brushes.White, new Rectangle(0, ItemSize.Height + 3, Width, Height));
  828.         using (StringFormat SF = new StringFormat { LineAlignment = StringAlignment.Center })
  829.         {
  830.  
  831.             for (int i = 0; i <= TabCount - 1; i++)
  832.             {
  833.                 R = GetTabRect(i);
  834.  
  835.                 if (i == SelectedIndex)
  836.                 {
  837.                     G.FillRectangle(Brushes.Red, new Rectangle(R.X - 2, R.Height - 4, R.Width - 1, 4));
  838.  
  839.                     G.DrawString(TabPages[i].Text, Font, Brushes.DarkGray, R, H.SetPosition());
  840.  
  841.                 }
  842.                 else
  843.                 {
  844.  
  845.                     if (R.Contains(_LocatedPostion))
  846.                     {
  847.                         G.DrawString(TabPages[i].Text, Font, Brushes.DarkGray, R, H.SetPosition());
  848.                     }
  849.                     else
  850.                     {
  851.                         G.DrawString(TabPages[i].Text, Font, Brushes.Gray, R, H.SetPosition());
  852.                     }
  853.  
  854.                 }
  855.             }
  856.  
  857.         }
  858.  
  859.     }
  860.  
  861.     #endregion
  862.  
  863. }
  864.  
  865. #endregion
  866.  
  867. #region  Button
  868.  
  869. public class YoutubeButton : Control
  870. {
  871.  
  872.     #region  Declarations
  873.  
  874.     private static readonly HelperMethods H = new HelperMethods();
  875.     private MouseMode State;
  876.     private iStyle _Style;
  877.     private int _BorderRadius;
  878.  
  879.     #endregion
  880.  
  881.     #region  Constructors
  882.  
  883.     public YoutubeButton()
  884.     {
  885.         SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true);
  886.         DoubleBuffered = true;
  887.         UpdateStyles();
  888.         BackColor = Color.Transparent;
  889.         Font = new Font("Segoe UI", 10);
  890.         _BorderRadius = 0;
  891.         _Style = iStyle.Light;
  892.         State = MouseMode.Normal;
  893.     }
  894.  
  895.     #endregion
  896.  
  897.     #region  Events
  898.  
  899.     protected override void OnMouseDown(MouseEventArgs e)
  900.     {
  901.         base.OnMouseDown(e);
  902.         State = MouseMode.Pushed;
  903.         Cursor = Cursors.Hand;
  904.         Invalidate();
  905.     }
  906.  
  907.     protected override void OnMouseHover(EventArgs e)
  908.     {
  909.         base.OnMouseHover(e);
  910.         State = MouseMode.Hovered;
  911.         Cursor = Cursors.Hand;
  912.         Invalidate();
  913.     }
  914.  
  915.     protected override void OnMouseLeave(EventArgs e)
  916.     {
  917.         base.OnMouseLeave(e);
  918.         State = MouseMode.Normal;
  919.         Cursor = Cursors.Default;
  920.         Invalidate();
  921.     }
  922.  
  923.     protected override void OnMouseUp(MouseEventArgs e)
  924.     {
  925.         base.OnMouseUp(e);
  926.         State = MouseMode.Hovered;
  927.         Cursor = Cursors.Hand;
  928.         Invalidate();
  929.     }
  930.  
  931.  
  932.     #endregion
  933.  
  934.     #region  Properties
  935.  
  936.     [Category("Custom"), Description("Gets or sets the style for the control.")]
  937.     public iStyle Style
  938.     {
  939.         get { return _Style; }
  940.         set
  941.         {
  942.             _Style = value;
  943.             Invalidate();
  944.         }
  945.     }
  946.  
  947.     [Category("Custom"), Description("Gets or sets the rounded corner degree of the control.")]
  948.     public int BorderRadius
  949.     {
  950.         get { return _BorderRadius; }
  951.         set
  952.         {
  953.             _BorderRadius = value;
  954.             Invalidate();
  955.         }
  956.     }
  957.  
  958.     #endregion
  959.  
  960.     #region  Draw Control
  961.  
  962.     protected override void OnPaint(PaintEventArgs e)
  963.     {
  964.         Graphics G = e.Graphics;
  965.         Rectangle Rect = new Rectangle(0, 0, Width - 1, Height - 1);
  966.         G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
  967.         GraphicsPath GP = new GraphicsPath();
  968.  
  969.         if (BorderRadius > 1)
  970.         {
  971.             G.SmoothingMode = SmoothingMode.AntiAlias;
  972.             GP = H.RoundRec(Rect, BorderRadius);
  973.         }
  974.         else
  975.         {
  976.             GP.AddRectangle(Rect);
  977.         }
  978.  
  979.         switch (State)
  980.         {
  981.             case MouseMode.Normal:
  982.                 G.FillPath(Style == iStyle.Light ? Brushes.LightSilver : Brushes.Blue, GP);
  983.                 G.DrawPath(Style == iStyle.Light ? Pens.Silver : Pens.LighterBlue, GP);
  984.                 G.DrawString(Text, Font, Style == iStyle.Light ? Brushes.Gray : Brushes.White, Rect, H.SetPosition());
  985.                 break;
  986.             case MouseMode.Hovered:
  987.                 G.FillPath(Style == iStyle.Light ? Brushes.Silver : Brushes.LighterBlue, GP);
  988.                 G.DrawPath(Style == iStyle.Light ? Pens.Silver : Pens.Blue, GP);
  989.                 G.DrawString(Text, Font, Style == iStyle.Light ? Brushes.Gray : Brushes.White, Rect, H.SetPosition());
  990.                 break;
  991.             case MouseMode.Pushed:
  992.                 G.FillPath(Style == iStyle.Light ? Brushes.LightGray : Brushes.DarkBlue, GP);
  993.                 G.DrawPath(Style == iStyle.Light ? Pens.Silver : Pens.DarkBlue, GP);
  994.                 G.DrawString(Text, Font, Style == iStyle.Light ? Brushes.Gray : Brushes.White, Rect, H.SetPosition());
  995.                 break;
  996.         }
  997.  
  998.     }
  999.  
  1000.     #endregion
  1001.  
  1002.     #region  Enumerators
  1003.  
  1004.     public enum iStyle
  1005.     {
  1006.         Light,
  1007.         Blue
  1008.     }
  1009.  
  1010.     #endregion
  1011.  
  1012. }
  1013.  
  1014.  
  1015. #endregion
  1016.  
  1017. #region  ButtonX
  1018.  
  1019. public class YoutubeButtonX : Control
  1020. {
  1021.  
  1022.     #region  Declarations
  1023.  
  1024.     private static readonly HelperMethods H = new HelperMethods();
  1025.     private string _LeftText;
  1026.     private string _RightText;
  1027.     private Rectangle RedPart;
  1028.     private Rectangle LightPart;
  1029.     private MouseMode State;
  1030.     private iStyle _Style;
  1031.  
  1032.     #endregion
  1033.  
  1034.     #region  Constructors
  1035.  
  1036.     public YoutubeButtonX()
  1037.     {
  1038.         SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true);
  1039.         DoubleBuffered = true;
  1040.         UpdateStyles();
  1041.         BackColor = Color.Transparent;
  1042.         Font = new Font("Segoe UI", 10);
  1043.         _Style = iStyle.Red;
  1044.         State = MouseMode.Normal;
  1045.         _LeftText = "12,961,386";
  1046.         _RightText = "Subscribe";
  1047.     }
  1048.  
  1049.     #endregion
  1050.  
  1051.     #region  Events
  1052.  
  1053.     protected override void OnMouseDown(MouseEventArgs e)
  1054.     {
  1055.         base.OnMouseDown(e);
  1056.         State = MouseMode.Pushed;
  1057.         Cursor = Cursors.Hand;
  1058.         Invalidate();
  1059.     }
  1060.  
  1061.     protected override void OnMouseHover(EventArgs e)
  1062.     {
  1063.         base.OnMouseHover(e);
  1064.         State = MouseMode.Hovered;
  1065.         Cursor = Cursors.Hand;
  1066.         Invalidate();
  1067.     }
  1068.  
  1069.     protected override void OnMouseLeave(EventArgs e)
  1070.     {
  1071.         base.OnMouseLeave(e);
  1072.         State = MouseMode.Normal;
  1073.         Cursor = Cursors.Default;
  1074.         Invalidate();
  1075.     }
  1076.  
  1077.     protected override void OnMouseUp(MouseEventArgs e)
  1078.     {
  1079.         base.OnMouseUp(e);
  1080.         State = MouseMode.Hovered;
  1081.         Cursor = Cursors.Hand;
  1082.         Invalidate();
  1083.     }
  1084.  
  1085.  
  1086.     #endregion
  1087.  
  1088.     #region  Properties
  1089.  
  1090.     [Category("Custom"), Description("Gets or sets the style for the control.")]
  1091.     public iStyle Style
  1092.     {
  1093.         get { return _Style; }
  1094.         set
  1095.         {
  1096.             _Style = value;
  1097.             Invalidate();
  1098.         }
  1099.     }
  1100.  
  1101.     [Category("Custom"), Description("Gets or sets the text of the left side of the control.")]
  1102.     public string LeftText
  1103.     {
  1104.         get { return _LeftText; }
  1105.         set
  1106.         {
  1107.             _LeftText = value;
  1108.             Invalidate();
  1109.         }
  1110.     }
  1111.  
  1112.     [Category("Custom"), Description("Gets or sets the text of the right side of the control.")]
  1113.     public string RightText
  1114.     {
  1115.         get { return _RightText; }
  1116.         set
  1117.         {
  1118.             _RightText = value;
  1119.             Invalidate();
  1120.         }
  1121.     }
  1122.  
  1123.     #endregion
  1124.  
  1125.     #region  Draw Control
  1126.  
  1127.     protected override void OnPaint(PaintEventArgs e)
  1128.     {
  1129.         Graphics G = e.Graphics;
  1130.         Rectangle Rect = new Rectangle(0, 0, Width - 1, Height - 1);
  1131.         G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
  1132.         G.SmoothingMode = SmoothingMode.AntiAlias;
  1133.         RedPart = new Rectangle(0, 0, Width / 2, Height);
  1134.         LightPart = new Rectangle(Width / 2, 0, Width - Width / 2, Height);
  1135.  
  1136.         switch (State)        {
  1137.  
  1138.             case MouseMode.Normal:
  1139.                 G.FillPath(Style == iStyle.Red ? Brushes.Red : Brushes.Blue, H.RoundRec(RedPart, 6, true, false, true, false));
  1140.                 G.FillRectangle(Brushes.LightSilver, LightPart);
  1141.                 G.DrawLine(Pens.Silver, Convert.ToInt32(Width / 2), 0, Convert.ToInt32(Width - 1), 0);
  1142.                 G.DrawLine(Pens.Silver, Convert.ToInt32(Width / 2), Height - 1, Width, Height - 1);
  1143.                 G.DrawLine(Pens.Silver, Width - 1, 0, Width - 1, Height);
  1144.                 G.DrawString(RightText, Font, Brushes.White, RedPart, H.SetPosition());
  1145.                 G.DrawString(LeftText, Font, Brushes.Gray, LightPart, H.SetPosition());
  1146.                 break;
  1147.             case MouseMode.Hovered:
  1148.                 G.FillPath(Style == iStyle.Red ? Brushes.LightRed : Brushes.LighterBlue, H.RoundRec(RedPart, 6, true, false, true, false));
  1149.                 G.FillRectangle(Brushes.LightSilver, LightPart);
  1150.                 G.DrawLine(Pens.Silver, Convert.ToInt32(Width / 2), 0, Convert.ToInt32(Width - 1), 0);
  1151.                 G.DrawLine(Pens.Silver, Convert.ToInt32(Width / 2), Height - 1, Width, Height - 1);
  1152.                 G.DrawLine(Pens.Silver, Width - 1, 0, Width - 1, Height);
  1153.                 G.DrawString(RightText, Font, Brushes.White, RedPart, H.SetPosition());
  1154.                 G.DrawString(LeftText, Font, Brushes.Gray, LightPart, H.SetPosition());
  1155.                 break;
  1156.             case MouseMode.Pushed:
  1157.                 G.FillPath(Style == iStyle.Red ? Brushes.DarkRed : Brushes.DarkBlue, H.RoundRec(RedPart, 6, true, false, true, false));
  1158.                 G.FillRectangle(Brushes.LightSilver, LightPart);
  1159.                 G.DrawLine(Pens.Silver, Convert.ToInt32(Width / 2), 0, Convert.ToInt32(Width - 1), 0);
  1160.                 G.DrawLine(Pens.Silver, Convert.ToInt32(Width / 2), Height - 1, Width, Height - 1);
  1161.                 G.DrawLine(Pens.Silver, Width - 1, 0, Width - 1, Height);
  1162.                 G.DrawString(RightText, Font, Brushes.White, RedPart, H.SetPosition());
  1163.                 G.DrawString(LeftText, Font, Brushes.Gray, LightPart, H.SetPosition());
  1164.                 break;
  1165.         }
  1166.  
  1167.     }
  1168.  
  1169.     #endregion
  1170.  
  1171.     #region  Enumerators
  1172.  
  1173.     public enum iStyle
  1174.     {
  1175.         Blue,
  1176.         Red
  1177.     }
  1178.  
  1179.     #endregion
  1180.  
  1181. }
  1182.  
  1183.  
  1184. #endregion
  1185.  
  1186. #region TextBox
  1187.  
  1188. [DefaultEvent("TextChanged")]
  1189. public class YoutubeTextbox : Control
  1190. {
  1191.  
  1192.     #region Declarations
  1193.  
  1194.     private TextBox _T = new TextBox();
  1195.     private TextBox T
  1196.     {
  1197.         get { return _T; }
  1198.         set
  1199.         {
  1200.             if (_T != null)
  1201.             {
  1202.                 _T.MouseLeave -= T_MouseLeave;
  1203.                 _T.MouseEnter -= T_MouseEnter;
  1204.                 _T.MouseDown -= T_MouseEnter;
  1205.                 _T.MouseHover -= T_MouseEnter;
  1206.                 _T.TextChanged -= T_TextChanged;
  1207.                 _T.KeyDown -= T_KeyDown;
  1208.             }
  1209.             _T = value;
  1210.             if (_T != null)
  1211.             {
  1212.                 _T.MouseLeave += T_MouseLeave;
  1213.                 _T.MouseEnter += T_MouseEnter;
  1214.                 _T.MouseDown += T_MouseEnter;
  1215.                 _T.MouseHover += T_MouseEnter;
  1216.                 _T.TextChanged += T_TextChanged;
  1217.                 _T.KeyDown += T_KeyDown;
  1218.             }
  1219.         }
  1220.     }
  1221.     private static readonly HelperMethods H = new HelperMethods();
  1222.     private HorizontalAlignment _TextAlign;
  1223.     private int _MaxLength;
  1224.     private bool _ReadOnly;
  1225.     private bool _UseSystemPasswordChar;
  1226.     private string _WatermarkText;
  1227.     private Image _Image;
  1228.     private MouseMode State;
  1229.     private AutoCompleteSource _AutoCompleteSource;
  1230.     private AutoCompleteMode _AutoCompleteMode;
  1231.     private AutoCompleteStringCollection _AutoCompleteCustomSource;
  1232.     private bool _Multiline;
  1233.     private string[] _Lines;
  1234.  
  1235.  
  1236.     #endregion
  1237.  
  1238.     #region Native Methods
  1239.  
  1240.     [DllImport("user32.dll", CharSet = CharSet.Auto)]
  1241.     static extern IntPtr SendMessage(IntPtr hWnd, int Msg, int wParam, string lParam);
  1242.  
  1243.     #endregion
  1244.  
  1245.     #region Properties
  1246.  
  1247.     [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
  1248.     public BorderStyle BorderStyle
  1249.     {
  1250.         get
  1251.         {
  1252.             return BorderStyle.None;
  1253.         }
  1254.     }
  1255.  
  1256.     [Category("Custom"), Description("Gets or sets how text is aligned in TextBox control.")]
  1257.     public HorizontalAlignment TextAlign
  1258.     {
  1259.         get { return _TextAlign; }
  1260.         set
  1261.         {
  1262.             _TextAlign = value;
  1263.             if (T != null)
  1264.             {
  1265.                 T.TextAlign = value;
  1266.             }
  1267.             Invalidate();
  1268.         }
  1269.     }
  1270.  
  1271.     [Category("Custom"), Description("Gets or sets how text is aligned in TextBox control.")]
  1272.     public int MaxLength
  1273.     {
  1274.         get { return _MaxLength; }
  1275.         set
  1276.         {
  1277.             _MaxLength = value;
  1278.             if (T != null)
  1279.             {
  1280.                 T.MaxLength = value;
  1281.             }
  1282.             Invalidate();
  1283.         }
  1284.     }
  1285.  
  1286.     [Browsable(false), ReadOnly(true)]
  1287.     public override Color BackColor
  1288.     {
  1289.         get { return Color.Transparent; }
  1290.     }
  1291.  
  1292.     [Browsable(false), ReadOnly(true)]
  1293.     public override Color ForeColor
  1294.     {
  1295.         get { return Color.Transparent; }        
  1296.     }
  1297.  
  1298.     [Category("Custom"), Description("Gets or sets a value indicating whether text in the text box is read-only.")]
  1299.     public bool ReadOnly
  1300.     {
  1301.         get { return _ReadOnly; }
  1302.         set
  1303.         {
  1304.             _ReadOnly = value;
  1305.             if (T != null)
  1306.             {
  1307.                 T.ReadOnly = value;
  1308.             }
  1309.         }
  1310.     }
  1311.  
  1312.     [Category("Custom"), Description("Gets or sets a value indicating whether the text in  TextBox control should appear as the default password character.")]
  1313.     public bool UseSystemPasswordChar
  1314.     {
  1315.         get { return _UseSystemPasswordChar; }
  1316.         set
  1317.         {
  1318.             _UseSystemPasswordChar = value;
  1319.             if (T != null)
  1320.             {
  1321.                 T.UseSystemPasswordChar = value;
  1322.             }
  1323.         }
  1324.     }
  1325.  
  1326.     [Category("Custom"), Description("Gets or sets a value indicating whether this is a multiline System.Windows.Forms.TextBox control.")]
  1327.     public bool Multiline
  1328.     {
  1329.         get { return _Multiline; }
  1330.         set
  1331.         {
  1332.             _Multiline = value;
  1333.             if (T == null)
  1334.                 return;
  1335.             T.Multiline = value;
  1336.             if (value)
  1337.             {
  1338.                 T.Height = Height - 10;
  1339.             }
  1340.             else
  1341.             {
  1342.                 Height = T.Height + 10;
  1343.             }
  1344.         }
  1345.     }
  1346.  
  1347.     [Browsable(false), EditorBrowsable(EditorBrowsableState.Never), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
  1348.     public new Image BackgroundImage
  1349.     {
  1350.         get { return null; }
  1351.     }
  1352.  
  1353.     [Category("Custom"), Description("Gets or sets the current text in  TextBox.")]
  1354.     public override string Text
  1355.     {
  1356.         get { return base.Text; }
  1357.         set
  1358.         {
  1359.             base.Text = value;
  1360.             if (T != null)
  1361.             {
  1362.                 T.Text = value;
  1363.             }
  1364.         }
  1365.     }
  1366.  
  1367.     [Category("Custom"), Description("Gets or sets the text in the System.Windows.Forms.TextBox while being empty.")]
  1368.     public string WatermarkText
  1369.     {
  1370.         get { return _WatermarkText; }
  1371.         set
  1372.         {
  1373.             _WatermarkText = value;
  1374.             SendMessage(T.Handle, 5377, 0, value);
  1375.             Invalidate();
  1376.         }
  1377.     }
  1378.  
  1379.     [Category("Custom"), Description("Gets or sets the image of the control.")]
  1380.     public Image Image
  1381.     {
  1382.         get { return _Image; }
  1383.         set
  1384.         {
  1385.             _Image = value;
  1386.             Invalidate();
  1387.         }
  1388.     }
  1389.  
  1390.     [Category("Custom"), Description("Gets or sets a value specifying the source of complete strings used for automatic completion.")]
  1391.     public AutoCompleteSource AutoCompleteSource
  1392.     {
  1393.         get { return _AutoCompleteSource; }
  1394.         set
  1395.         {
  1396.             _AutoCompleteSource = value;
  1397.             if (T != null)
  1398.             {
  1399.                 T.AutoCompleteSource = value;
  1400.             }
  1401.             Invalidate();
  1402.         }
  1403.     }
  1404.  
  1405.     [Category("Custom"), Description("Gets or sets a value specifying the source of complete strings used for automatic completion.")]
  1406.     public AutoCompleteStringCollection AutoCompleteCustomSource
  1407.     {
  1408.         get { return _AutoCompleteCustomSource; }
  1409.         set
  1410.         {
  1411.             _AutoCompleteCustomSource = value;
  1412.             if (T != null)
  1413.             {
  1414.                 T.AutoCompleteCustomSource = value;
  1415.             }
  1416.             Invalidate();
  1417.         }
  1418.     }
  1419.  
  1420.     [Category("Custom"), Description("Gets or sets an option that controls how automatic completion works for the TextBox.")]
  1421.     public AutoCompleteMode AutoCompleteMode
  1422.     {
  1423.         get { return _AutoCompleteMode; }
  1424.         set
  1425.         {
  1426.             _AutoCompleteMode = value;
  1427.             if (T != null)
  1428.             {
  1429.                 T.AutoCompleteMode = value;
  1430.             }
  1431.             Invalidate();
  1432.         }
  1433.     }
  1434.  
  1435.     [Category("Custom"), Description("Gets or sets the font of the text displayed by the control.")]
  1436.     public new Font Font
  1437.     {
  1438.         get { return base.Font; }
  1439.         set
  1440.         {
  1441.             base.Font = value;
  1442.             if (T == null)
  1443.                 return;
  1444.             T.Font = value;
  1445.             T.Location = new Point(5, 5);
  1446.             T.Width = Width - 8;
  1447.             if (!Multiline)
  1448.                 Height = T.Height + 11;
  1449.         }
  1450.     }
  1451.  
  1452.     [Category("Custom"), Description("Gets or sets the lines of text in the control.")]
  1453.     public string[] Lines
  1454.     {
  1455.         get { return _Lines; }
  1456.         set
  1457.         {
  1458.             _Lines = value;
  1459.             if (T == null)
  1460.                 return;
  1461.             T.Lines = value;
  1462.             Invalidate();
  1463.         }
  1464.     }
  1465.  
  1466.     [Category("Custom"), Description("Gets or sets the ContextMenuStrip associated with this control.")]
  1467.     public override ContextMenuStrip ContextMenuStrip
  1468.     {
  1469.         get { return base.ContextMenuStrip; }
  1470.         set
  1471.         {
  1472.             base.ContextMenuStrip = value;
  1473.             if (T == null)
  1474.                 return;
  1475.             T.ContextMenuStrip = value;
  1476.             Invalidate();
  1477.         }
  1478.     }
  1479.  
  1480.     #endregion
  1481.  
  1482.     #region Constructors
  1483.  
  1484.     public YoutubeTextbox()
  1485.     {
  1486.         SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true);
  1487.         DoubleBuffered = true;
  1488.         UpdateStyles();
  1489.         _TextAlign = HorizontalAlignment.Left;
  1490.         _MaxLength = 32767;
  1491.         _ReadOnly = false;
  1492.         _UseSystemPasswordChar = false;
  1493.         _WatermarkText = string.Empty;
  1494.         _Image = null;
  1495.         State = HelperMethods.MouseMode.Normal;
  1496.         _AutoCompleteSource = AutoCompleteSource.None;
  1497.         _AutoCompleteMode = AutoCompleteMode.None;
  1498.         _Multiline = false;
  1499.         _Lines = null;
  1500.         Font = new Font("Segoe UI", 10);
  1501.         T.Multiline = false;
  1502.         T.Cursor = Cursors.IBeam;
  1503.         T.BackColor = Colors.White;
  1504.         T.ForeColor = Colors.Silver;
  1505.         T.BorderStyle = BorderStyle.None;
  1506.         T.Location = new Point(7, 8);
  1507.         T.Font = Font;
  1508.         T.UseSystemPasswordChar = UseSystemPasswordChar;
  1509.         Size = new Size(135, 30);
  1510.         if (Multiline)
  1511.         {
  1512.             T.Height = Height - 11;
  1513.         }
  1514.         else
  1515.         {
  1516.             Height = T.Height + 11;
  1517.         }
  1518.     }
  1519.  
  1520.     #endregion
  1521.  
  1522.     #region Events
  1523.  
  1524.     public new event TextChangedEventHandler TextChanged;
  1525.     public delegate void TextChangedEventHandler(object sender);
  1526.  
  1527.     protected override void OnCreateControl()
  1528.     {
  1529.         base.OnCreateControl();
  1530.         if (!Controls.Contains(T))
  1531.             Controls.Add(T);
  1532.     }
  1533.  
  1534.     protected override void OnResize(EventArgs e)
  1535.     {
  1536.         base.OnResize(e);
  1537.         T.Size = new Size(Width - 10, Height - 10);
  1538.     }
  1539.  
  1540.     #region TextBox MouseEvents
  1541.  
  1542.     private void T_MouseLeave(object sender, EventArgs e)
  1543.     {
  1544.         State = HelperMethods.MouseMode.Normal;
  1545.         Invalidate();
  1546.     }
  1547.  
  1548.     private void T_MouseEnter(object sender, EventArgs e)
  1549.     {
  1550.         State = HelperMethods.MouseMode.Pushed;
  1551.         Invalidate();
  1552.     }
  1553.  
  1554.     private void T_TextChanged(object sender, EventArgs e)
  1555.     {
  1556.         Text = T.Text;
  1557.         TextChanged?.Invoke(this);
  1558.         Invalidate();
  1559.     }
  1560.  
  1561.     private void T_KeyDown(object sender, KeyEventArgs e)
  1562.     {
  1563.         if (e.Control && e.KeyCode == Keys.A)
  1564.             e.SuppressKeyPress = true;
  1565.         if (e.Control && e.KeyCode == Keys.C)
  1566.         {
  1567.             T.Copy();
  1568.             e.SuppressKeyPress = true;
  1569.         }
  1570.         State = MouseMode.Pushed;
  1571.         Invalidate();
  1572.     }
  1573.  
  1574.     #endregion
  1575.  
  1576.     #endregion
  1577.  
  1578.     #region Draw Control
  1579.  
  1580.     protected override void OnPaint(PaintEventArgs e)
  1581.     {
  1582.         Graphics G = e.Graphics;
  1583.         G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
  1584.  
  1585.         GraphicsPath GP = new GraphicsPath();
  1586.         Rectangle Rect = new Rectangle(0, 0, Width - 1, Height - 1);
  1587.  
  1588.         GP.AddRectangle(Rect);
  1589.  
  1590.         GP.CloseFigure();
  1591.         using (PathGradientBrush B = new PathGradientBrush(GP) { CenterColor = Colors.White, SurroundColors = new Color[] { Colors.LightSilver }, FocusScales = new PointF(0.98f, 0.75f) })
  1592.         using (Pen P = new Pen(Colors.Silver))
  1593.         using (Pen P2 = new Pen(Colors.Blue))
  1594.         {
  1595.             switch (State)
  1596.             {
  1597.                 case MouseMode.Normal:
  1598.                     G.FillRectangle(B, Rect);
  1599.                     G.DrawRectangle(P, Rect);
  1600.                     break;
  1601.                 case MouseMode.Pushed:
  1602.                     G.FillRectangle(B, Rect);
  1603.                     G.DrawRectangle(P2, Rect);
  1604.                     break;
  1605.             }
  1606.  
  1607.         }
  1608.        
  1609.  
  1610.         if (Image != null)
  1611.         {
  1612.             T.Location = new Point(31, 5);
  1613.             T.Width = Width - 60;
  1614.             G.InterpolationMode = InterpolationMode.HighQualityBicubic;
  1615.             G.DrawImage(Image, new Rectangle(8, 6, 16, 16));
  1616.         }
  1617.         else
  1618.         {
  1619.            
  1620.             T.Location = new Point(7, 5);
  1621.             T.Width = Width - 10;
  1622.            
  1623.         }
  1624.  
  1625.         GP.Dispose();
  1626.  
  1627.     }
  1628.  
  1629.     #endregion
  1630.  
  1631. }
  1632.  
  1633. #endregion
  1634.  
  1635. #region  Seperator
  1636.  
  1637. public class YoutubeSeperator : Control
  1638. {
  1639.  
  1640.     #region  Variables
  1641.  
  1642.     private Style _SeperatorStyle;
  1643.     private Color _SeperatorColor;
  1644.  
  1645.     #endregion
  1646.  
  1647.     #region  Enumerators
  1648.  
  1649.     public enum Style
  1650.     {
  1651.         Horizental,
  1652.         Vertiacal
  1653.     }
  1654.  
  1655.     #endregion
  1656.  
  1657.     #region  Properties
  1658.  
  1659.     [Category("Custom"), Description("Gets or sets the style for the control.")]
  1660.     public Style SeperatorStyle
  1661.     {
  1662.         get { return _SeperatorStyle; }
  1663.         set
  1664.         {
  1665.             _SeperatorStyle = value;
  1666.             Invalidate();
  1667.         }
  1668.     }
  1669.  
  1670.     [Category("Custom"), Description("Gets or sets the color for the control.")]
  1671.     public Color SeperatorColor
  1672.     {
  1673.         get { return _SeperatorColor; }
  1674.         set
  1675.         {
  1676.             _SeperatorColor = value;
  1677.             Invalidate();
  1678.         }
  1679.     }
  1680.  
  1681.     #endregion
  1682.  
  1683.     #region  Constructors
  1684.  
  1685.     public YoutubeSeperator()
  1686.     {
  1687.         SetStyle(ControlStyles.SupportsTransparentBackColor | ControlStyles.UserPaint, true);
  1688.         DoubleBuffered = true;
  1689.         UpdateStyles();
  1690.         BackColor = Color.Transparent;
  1691.         _SeperatorStyle = Style.Horizental;
  1692.         _SeperatorColor = Colors.Silver;
  1693.     }
  1694.  
  1695.     #endregion
  1696.  
  1697.     #region  Draw Control
  1698.  
  1699.     protected override void OnPaint(PaintEventArgs e)
  1700.     {
  1701.         Graphics G = e.Graphics;
  1702.         using (Pen P = new Pen(SeperatorColor))
  1703.         {
  1704.             switch (SeperatorStyle)
  1705.             {
  1706.                 case Style.Horizental:
  1707.                     G.DrawLine(P, 0, 1, Width, 1);
  1708.                     break;
  1709.                 case Style.Vertiacal:
  1710.                     G.DrawLine(P, 1, 0, 1, Height);
  1711.                     break;
  1712.             }
  1713.         }
  1714.  
  1715.     }
  1716.  
  1717.     #endregion
  1718.  
  1719.     #region  Events
  1720.  
  1721.     protected override void OnResize(EventArgs e)
  1722.     {
  1723.         base.OnResize(e);
  1724.         if (SeperatorStyle == Style.Horizental)
  1725.         {
  1726.             Height = 4;
  1727.         }
  1728.         else
  1729.         {
  1730.             Width = 4;
  1731.         }
  1732.     }
  1733.  
  1734.     #endregion
  1735.  
  1736. }
  1737.  
  1738. #endregion
  1739.  
  1740. #region  Label
  1741.  
  1742. [DefaultEvent("TextChanged")]
  1743. public class YoutubeLabel : Control
  1744. {
  1745.  
  1746.     #region  Draw Cotnrol
  1747.  
  1748.     protected override void OnPaint(PaintEventArgs e)
  1749.     {
  1750.         e.Graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
  1751.         using (SolidBrush TB = new SolidBrush(ForeColor))
  1752.         {
  1753.             e.Graphics.DrawString(Text, Font, TB, ClientRectangle);
  1754.         }
  1755.     }
  1756.  
  1757.     #endregion
  1758.  
  1759.     #region  Constructors
  1760.  
  1761.     public YoutubeLabel()
  1762.     {
  1763.         SetStyle(ControlStyles.SupportsTransparentBackColor | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
  1764.         DoubleBuffered = true;
  1765.         UpdateStyles();
  1766.         BackColor = Color.Transparent;
  1767.         ForeColor = Color.Silver;
  1768.         Font = new Font("Myriad Pro", 10);
  1769.     }
  1770.  
  1771.     #endregion
  1772.  
  1773.     #region  Events
  1774.  
  1775.     public new event TextChangedEventHandler TextChanged;
  1776.     public delegate void TextChangedEventHandler(object sender);
  1777.  
  1778.     protected override void OnResize(EventArgs e)
  1779.     {
  1780.         Height = Font.Height;
  1781.     }
  1782.  
  1783.     protected override void OnTextChanged(EventArgs e)
  1784.     {
  1785.         base.OnTextChanged(e);
  1786.         TextChanged?.Invoke(this);
  1787.         Invalidate();
  1788.     }
  1789.  
  1790.     #endregion
  1791.  
  1792. }
  1793.  
  1794. #endregion
  1795.  
  1796. #region  Link Label
  1797. class YoutubeLinkLabel : LinkLabel
  1798. {
  1799.  
  1800.     #region  Constructors
  1801.  
  1802.     public YoutubeLinkLabel()
  1803.     {
  1804.         Font = new Font("Myriad Pro", 10);
  1805.         BackColor = Color.Transparent;
  1806.         LinkColor = Colors.Blue;
  1807.         ActiveLinkColor = Color.FromArgb(40, 113, 164);
  1808.         VisitedLinkColor = Color.FromArgb(29, 83, 120);
  1809.         LinkBehavior = LinkBehavior.HoverUnderline;
  1810.     }
  1811.  
  1812.     #endregion
  1813.  
  1814. }
  1815.  
  1816. #endregion
  1817.  
  1818. #region  Progress
  1819.  
  1820. [DefaultEvent("ValueChanged"), DefaultProperty("Value")]
  1821. public class YoutubeProgressBar : Control
  1822. {
  1823.  
  1824.     #region  Declarations
  1825.  
  1826.     private int _Value;
  1827.     private int _Maximum;
  1828.     public event ValueChangedEventHandler ValueChanged;
  1829.     public delegate void ValueChangedEventHandler(object sender);
  1830.  
  1831.     private iStyle _Style;
  1832.     #endregion
  1833.  
  1834.     #region  Constructors
  1835.  
  1836.     public YoutubeProgressBar()
  1837.     {
  1838.         SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true);
  1839.         DoubleBuffered = true;
  1840.         UpdateStyles();
  1841.         BackColor = Color.Transparent;
  1842.         _Maximum = 100;
  1843.         _Value = 0;
  1844.         _Style = iStyle.Red;
  1845.     }
  1846.  
  1847.     #endregion
  1848.  
  1849.     #region  Properties
  1850.  
  1851.     [Category("Custom"), Description("Gets or sets the current position of the progressbar.")]
  1852.     public int Value
  1853.     {
  1854.         get
  1855.         {
  1856.             if (_Value < 0)
  1857.             {
  1858.                 return 0;
  1859.             }
  1860.             else
  1861.             {
  1862.                 return _Value;
  1863.             }
  1864.         }
  1865.         set
  1866.         {
  1867.             if (value > Maximum)
  1868.             {
  1869.                 value = Maximum;
  1870.             }
  1871.             _Value = value;
  1872.             ValueChanged?.Invoke(this);
  1873.             Invalidate();
  1874.         }
  1875.     }
  1876.  
  1877.     [Category("Custom"), Description("Gets or sets the maximum value of the progressbar.")]
  1878.     public int Maximum
  1879.     {
  1880.         get { return _Maximum; }
  1881.         set
  1882.         {
  1883.             if (value < _Value)
  1884.             {
  1885.                 _Value = Value;
  1886.             }
  1887.             _Maximum = value;
  1888.             Invalidate();
  1889.         }
  1890.     }
  1891.  
  1892.     [Category("Custom"), Description("Gets or sets the style for the control.")]
  1893.     public iStyle Style
  1894.     {
  1895.         get { return _Style; }
  1896.         set
  1897.         {
  1898.             _Style = value;
  1899.             Invalidate();
  1900.         }
  1901.     }
  1902.  
  1903.     #endregion
  1904.  
  1905.     #region  Draw Control
  1906.    
  1907.     protected override void OnPaint(PaintEventArgs e)
  1908.     {
  1909.         Graphics G = e.Graphics;
  1910.         GraphicsPath GP = new GraphicsPath();
  1911.  
  1912.         int CurrentValue = Convert.ToInt32((double)Value / Maximum * Width);
  1913.         Rectangle Rect = new Rectangle(0, 0, Width, Height);
  1914.  
  1915.         G.FillRectangle(Brushes.LightGray, Rect);
  1916.  
  1917.  
  1918.         if (CurrentValue != 0)
  1919.         {
  1920.             G.FillRectangle(Style == iStyle.Red ? Brushes.Red : Brushes.Blue, new Rectangle(Rect.X, Rect.Y, CurrentValue, Rect.Height));
  1921.         }
  1922.  
  1923.         GP.Dispose();
  1924.     }
  1925.  
  1926.     #endregion
  1927.  
  1928.     #region  Enumerators
  1929.  
  1930.     public enum iStyle
  1931.     {
  1932.         Red,
  1933.         Blue
  1934.     }
  1935.  
  1936.     #endregion
  1937.  
  1938. }
  1939.  
  1940. #endregion
  1941.  
  1942. #region  CheckBox
  1943.  
  1944. [DefaultEvent("CheckedChanged"), DefaultProperty("Checked")]
  1945. public class YoutubeCheckBox : Control
  1946. {
  1947.  
  1948.     #region  Declarations
  1949.  
  1950.     private static readonly HelperMethods H = new HelperMethods();
  1951.     private bool _Checked;
  1952.     protected MouseMode State = MouseMode.Normal;
  1953.  
  1954.     #endregion
  1955.  
  1956.     #region  Properties
  1957.  
  1958.     [Category("Custom"), Description("Gets or set a value indicating whether the control is in the checked state.")]
  1959.     public bool Checked
  1960.     {
  1961.         get { return _Checked; }
  1962.         set
  1963.         {
  1964.             _Checked = value;
  1965.             CheckedChanged?.Invoke(this);
  1966.             Invalidate();
  1967.         }
  1968.     }
  1969.  
  1970.     #endregion
  1971.  
  1972.     #region  Constructors
  1973.  
  1974.     public YoutubeCheckBox()
  1975.     {
  1976.         SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor | ControlStyles.UserPaint, true);
  1977.         DoubleBuffered = true;
  1978.         Cursor = Cursors.Hand;
  1979.         BackColor = Color.Transparent;
  1980.         ForeColor = Color.FromArgb(121, 121, 121);
  1981.         Font = new Font("Segoe UI", 9);
  1982.         UpdateStyles();
  1983.     }
  1984.  
  1985.     #endregion
  1986.  
  1987.     #region  Draw Control
  1988.  
  1989.     protected override void OnPaint(PaintEventArgs e)
  1990.     {
  1991.         Graphics G = e.Graphics;
  1992.         G.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;
  1993.         Rectangle rect = new Rectangle(0, 0, 18, 17);
  1994.         using (Font F = new Font("Marlett", 14))
  1995.         {
  1996.             G.FillRectangle(Brushes.LightSilver, rect);
  1997.             if (Checked)
  1998.             { G.DrawString("b", F, Brushes.Gray, new Rectangle(-2, 0, Width, Height));}
  1999.             G.DrawRectangle(Pens.Silver, new Rectangle(0, 0, 17, 16));
  2000.             G.DrawString(Text, Font, Brushes.Gray, new Rectangle(18, 1, Width, Height - 4), H.SetPosition(StringAlignment.Near));
  2001.         }
  2002.  
  2003.     }
  2004.  
  2005.     #endregion
  2006.  
  2007.     #region  Events
  2008.  
  2009.     public event CheckedChangedEventHandler CheckedChanged;
  2010.     public delegate void CheckedChangedEventHandler(object sender);
  2011.  
  2012.     protected override void OnClick(EventArgs e)
  2013.     {
  2014.         _Checked = !Checked;
  2015.         CheckedChanged?.Invoke(this);
  2016.         base.OnClick(e);
  2017.         Invalidate();
  2018.     }
  2019.  
  2020.     protected override void OnTextChanged(System.EventArgs e)
  2021.     {
  2022.         Invalidate();
  2023.         base.OnTextChanged(e);
  2024.     }
  2025.  
  2026.     protected override void OnResize(System.EventArgs e)
  2027.     {
  2028.         base.OnResize(e);
  2029.         Height = 17;
  2030.         Invalidate();
  2031.     }
  2032.  
  2033.     protected override void OnMouseHover(EventArgs e)
  2034.     {
  2035.         base.OnMouseHover(e);
  2036.         State = MouseMode.Hovered;
  2037.         Invalidate();
  2038.     }
  2039.  
  2040.     protected override void OnMouseLeave(EventArgs e)
  2041.     {
  2042.         base.OnMouseLeave(e);
  2043.         State = MouseMode.Normal;
  2044.         Invalidate();
  2045.     }
  2046.  
  2047.     protected override void OnHandleCreated(EventArgs e)
  2048.     {
  2049.         base.OnHandleCreated(e);
  2050.     }
  2051.  
  2052.     #endregion
  2053.  
  2054. }
  2055.  
  2056. #endregion
  2057.  
  2058. #region  RadioButton
  2059.  
  2060. [DefaultEvent("CheckedChanged"), DefaultProperty("Checked")]
  2061. public class YoutubeRadioButton : Control
  2062. {
  2063.  
  2064.     #region  Declarations
  2065.  
  2066.     private static readonly HelperMethods H = new HelperMethods();
  2067.     private bool _Checked;
  2068.     protected int _Group;
  2069.  
  2070.     #endregion
  2071.  
  2072.     #region  Properties
  2073.  
  2074.     [Category("Custom"), Description("Gets or set a value indicating whether the control is in the checked state.")]
  2075.     public bool Checked
  2076.     {
  2077.         get { return _Checked; }
  2078.         set
  2079.         {
  2080.             _Checked = value;
  2081.             CheckedChanged?.Invoke(this);
  2082.             Invalidate();
  2083.         }
  2084.     }
  2085.  
  2086.     [Category("Custom")]
  2087.     public int Group
  2088.     {
  2089.         get { return _Group; }
  2090.         set
  2091.         {
  2092.             _Group = value;
  2093.             Invalidate();
  2094.         }
  2095.     }
  2096.  
  2097.     #endregion
  2098.  
  2099.     #region  Constructors
  2100.  
  2101.     public YoutubeRadioButton()
  2102.     {
  2103.         SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor | ControlStyles.UserPaint, true);
  2104.         DoubleBuffered = true;
  2105.         UpdateStyles();
  2106.         Cursor = Cursors.Hand;
  2107.         BackColor = Color.Transparent;
  2108.         ForeColor = Color.FromArgb(121, 121, 121);
  2109.         Font = new Font("Segoe UI", 9);
  2110.         Group = 1;
  2111.     }
  2112.  
  2113.     #endregion
  2114.  
  2115.     #region  Draw Control
  2116.  
  2117.     protected override void OnPaint(PaintEventArgs e)
  2118.     {
  2119.         Graphics G = e.Graphics;
  2120.         G.SmoothingMode = SmoothingMode.AntiAlias;
  2121.         G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
  2122.  
  2123.         using (Font F = new Font("Marlett", 14))
  2124.         {
  2125.             G.FillEllipse(Brushes.LightSilver, new Rectangle(0, 0, 21, 21));
  2126.             if (Checked)
  2127.             { G.FillEllipse(Brushes.Gray, new Rectangle(5, 5, 10, 10)); }
  2128.             G.DrawString(Text, Font, Brushes.Gray, new Rectangle(21, 1, Width, Height - 2), H.SetPosition(StringAlignment.Near));
  2129.             G.DrawEllipse(Pens.Silver, new Rectangle(0, 0, 20, 20));
  2130.         }
  2131.  
  2132.     }
  2133.  
  2134.     #endregion
  2135.  
  2136.     #region  Events
  2137.  
  2138.     public event CheckedChangedEventHandler CheckedChanged;
  2139.     public delegate void CheckedChangedEventHandler(object sender);
  2140.  
  2141.     private void UpdateState()
  2142.     {
  2143.         if (!IsHandleCreated || !Checked)
  2144.             return;
  2145.         foreach (Control C in Parent.Controls)
  2146.         {
  2147.             if (!ReferenceEquals(C, this) && C is YoutubeRadioButton && ((YoutubeRadioButton)C).Group == _Group)
  2148.             {
  2149.                 ((YoutubeRadioButton)C).Checked = false;
  2150.             }
  2151.         }
  2152.     }
  2153.  
  2154.     protected override void OnClick(EventArgs e)
  2155.     {
  2156.         _Checked = !Checked;
  2157.         UpdateState();
  2158.         base.OnClick(e);
  2159.         Invalidate();
  2160.     }
  2161.  
  2162.     protected override void OnCreateControl()
  2163.     {
  2164.         UpdateState();
  2165.         base.OnCreateControl();
  2166.     }
  2167.  
  2168.     protected override void OnTextChanged(System.EventArgs e)
  2169.     {
  2170.         Invalidate();
  2171.         base.OnTextChanged(e);
  2172.     }
  2173.  
  2174.     protected override void OnResize(System.EventArgs e)
  2175.     {
  2176.         base.OnResize(e);
  2177.         Height = 22;
  2178.         Invalidate();
  2179.     }
  2180.  
  2181.     #endregion
  2182.  
  2183. }
  2184.  
  2185. #endregion
  2186.  
  2187. #region  ComboBox
  2188.  
  2189. [DefaultEvent("SelectedIndexChanged")]
  2190. public class YoutubeComboBox : ComboBox
  2191. {
  2192.  
  2193.     #region  Declarations
  2194.  
  2195.     private int _StartIndex = 0;
  2196.     private static readonly HelperMethods H = new HelperMethods();
  2197.     public new event SelectedIndexChangedEventHandler SelectedIndexChanged;
  2198.     public delegate void SelectedIndexChangedEventHandler(object sender);
  2199.  
  2200.     #endregion
  2201.  
  2202.     #region  Constructors
  2203.  
  2204.  
  2205.     public YoutubeComboBox()
  2206.     {
  2207.         SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.UserPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true);
  2208.         BackColor = Color.Transparent;
  2209.         Font = new Font("Segoe UI", 11);
  2210.         DrawMode = DrawMode.OwnerDrawFixed;
  2211.         DoubleBuffered = true;
  2212.         StartIndex = 0;
  2213.         DropDownStyle = ComboBoxStyle.DropDownList;
  2214.         UpdateStyles();
  2215.     }
  2216.  
  2217.     #endregion
  2218.  
  2219.     #region  Properties
  2220.  
  2221.     [Category("Custom Properties"), Description("Gets or sets the index specifying the currently selected item.")]
  2222.     private int StartIndex
  2223.     {
  2224.         get { return _StartIndex; }
  2225.         set
  2226.         {
  2227.             _StartIndex = value;
  2228.             try
  2229.             {
  2230.                 base.SelectedIndex = value;
  2231.                 SelectedIndexChanged?.Invoke(this);
  2232.             }
  2233.             catch
  2234.             {
  2235.             }
  2236.             Invalidate();
  2237.         }
  2238.     }
  2239.  
  2240.     #endregion
  2241.  
  2242.     #region  Draw Control
  2243.  
  2244.     protected override void OnDrawItem(DrawItemEventArgs e)
  2245.     {
  2246.         Graphics G = e.Graphics;
  2247.         G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
  2248.  
  2249.         try
  2250.         {
  2251.             using (SolidBrush BG = new SolidBrush((e.State & DrawItemState.Selected) == DrawItemState.Selected ? Colors.Gray : Colors.White))
  2252.             using (SolidBrush TC = new SolidBrush((e.State & DrawItemState.Selected) == DrawItemState.Selected ? Colors.White : Colors.Gray))
  2253.             using (Font F = new Font(Font.Name, 9))
  2254.             {
  2255.                 G.FillRectangle(BG, e.Bounds);
  2256.                 G.DrawString(GetItemText(Items[e.Index]), F, TC, e.Bounds);
  2257.             }
  2258.                
  2259.            
  2260.  
  2261.         }
  2262.         catch
  2263.         {
  2264.         }
  2265.  
  2266.     }
  2267.  
  2268.     protected override void OnPaint(PaintEventArgs e)
  2269.     {
  2270.         Graphics G = e.Graphics;
  2271.  
  2272.         G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
  2273.         GraphicsPath GP = new GraphicsPath();
  2274.         Rectangle Rect = new Rectangle(0, 0, Width - 1, Height - 1);
  2275.         GP.AddRectangle(Rect);
  2276.         GP.CloseFigure();
  2277.         using (PathGradientBrush B = new PathGradientBrush(GP) { CenterColor = Colors.White, SurroundColors = new Color[] { Colors.LightSilver }, FocusScales = new PointF(0.98f, 0.75f) })
  2278.         {
  2279.             G.FillPath(B, GP);
  2280.             G.DrawPath(Pens.Silver, GP);
  2281.         }
  2282.  
  2283.         G.SmoothingMode = SmoothingMode.AntiAlias;
  2284.  
  2285.         H.DrawTriangle(G, Colors.Silver, 2, new Point(Width - 20, 12), new Point(Width - 16, 16), new Point(Width - 16, 16), new Point(Width - 12, 12), new Point(Width - 16, 17), new Point(Width - 16, 16));
  2286.         G.SmoothingMode = SmoothingMode.None;
  2287.         using (Font F = new Font(Font.Name, 10))
  2288.         {
  2289.             G.DrawString(Text, F, Brushes.Silver, new Rectangle(7, 0, Width - 1, Height - 1), H.SetPosition(StringAlignment.Near));
  2290.         }
  2291.         GP.Dispose();
  2292.     }
  2293.  
  2294.     #endregion
  2295.  
  2296.     #region  Events
  2297.  
  2298.     protected override void OnResize(EventArgs e)
  2299.     {
  2300.         base.OnResize(e);
  2301.         Invalidate();
  2302.     }
  2303.  
  2304.     #endregion
  2305.  
  2306. }
  2307.  
  2308. #endregion
  2309.  
  2310. #region  GroupBox
  2311.  
  2312. public class YouTubeGroupBox : ContainerControl
  2313. {
  2314.  
  2315.     #region  Declarations
  2316.  
  2317.     private static readonly HelperMethods H = new HelperMethods();
  2318.     private Rectangle R;
  2319.     private iStyle _Style;
  2320.  
  2321.     #endregion
  2322.  
  2323.     #region  Properties
  2324.  
  2325.     [Category("Custom"), Description("Gets or sets the image of the control.")]
  2326.     public Image Image { get; set; }
  2327.  
  2328.     [Category("Custom"), Description("Gets or sets the style for the control.")]
  2329.     public iStyle Style
  2330.     {
  2331.         get { return _Style; }
  2332.         set
  2333.         {
  2334.             _Style = value;
  2335.             Invalidate();
  2336.         }
  2337.     }
  2338.  
  2339.  
  2340.     #endregion
  2341.  
  2342.     #region  Constructors
  2343.  
  2344.     public YouTubeGroupBox()
  2345.     {
  2346.         SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor, true);
  2347.         DoubleBuffered = true;
  2348.         Font = new Font("Segoe UI", 10);
  2349.         BackColor = Color.Transparent;
  2350.         UpdateStyles();
  2351.         Image = null;
  2352.         _Style = iStyle.Blue;
  2353.     }
  2354.  
  2355.     #endregion
  2356.  
  2357.     #region  Draw Control
  2358.  
  2359.     protected override void OnPaint(PaintEventArgs e)
  2360.     {
  2361.         Graphics G = e.Graphics;
  2362.         G.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
  2363.         Rectangle Rect = new Rectangle(0, 0, Width - 1, Height - 1);
  2364.         R = new Rectangle(Width - 30, 15, 20, 20);
  2365.         G.FillRectangle(Brushes.White, Rect);
  2366.         G.FillRectangle(Style == iStyle.Blue ? Brushes.Blue : Brushes.Red, new Rectangle(0, 0, Width - 1, 50));
  2367.         G.DrawString(Text, Font, Brushes.White, new Rectangle(Image == null ? 10 : 35, 0, Width - 1, 50), H.SetPosition(StringAlignment.Near));
  2368.         if (Image != null)
  2369.         { H.DrawImageWithColor(G, new Rectangle(12, 15, 18, 18), Image, Colors.White); }
  2370.         using (Font F = new Font(Font, FontStyle.Bold))
  2371.         {
  2372.             G.DrawString("x", F, Brushes.White, R, H.SetPosition());
  2373.         }
  2374.  
  2375.         G.DrawRectangle(Style == iStyle.Blue ? Pens.Blue : Pens.Red, Rect);
  2376.     }
  2377.  
  2378.     #endregion
  2379.  
  2380.     #region  Events
  2381.  
  2382.     protected override void OnMouseMove(MouseEventArgs e)
  2383.     {
  2384.         base.OnMouseMove(e);
  2385.         if (R.Contains(e.Location))
  2386.         {
  2387.             Cursor = Cursors.Hand;
  2388.         }
  2389.         else
  2390.         {
  2391.             Cursor = Cursors.Default;
  2392.         }
  2393.     }
  2394.  
  2395.     protected override void OnMouseDown(MouseEventArgs e)
  2396.     {
  2397.         base.OnMouseDown(e);
  2398.         if (e.Button == MouseButtons.Left && R.Contains(e.Location))
  2399.         {
  2400.             Parent.Controls.Remove(this);
  2401.         }
  2402.     }
  2403.  
  2404.     #endregion
  2405.  
  2406.     #region  Enumerators
  2407.  
  2408.     public enum iStyle
  2409.     {
  2410.         Blue,
  2411.         Red
  2412.     }
  2413.  
  2414.     #endregion
  2415.  
  2416. }
  2417.  
  2418. #endregion
  2419.  
  2420. #region Colors & Brushes Pens
  2421.  
  2422. public sealed class Colors
  2423. {
  2424.  
  2425.     public static Color Red
  2426.     {
  2427.         get { return Color.FromArgb(204, 24, 30); }
  2428.     }
  2429.  
  2430.     public static Color LightRed
  2431.     {
  2432.         get { return Color.FromArgb(230, 33, 23); }
  2433.     }
  2434.  
  2435.     public static Color DarkRed
  2436.     {
  2437.         get { return Color.FromArgb(179, 18, 23); }
  2438.     }
  2439.  
  2440.     public static Color Blue
  2441.     {
  2442.         get { return Color.FromArgb(18, 109, 179); }
  2443.     }
  2444.  
  2445.     public static Color LighterBlue
  2446.     {
  2447.         get { return Color.FromArgb(22, 122, 198); }
  2448.     }
  2449.  
  2450.     public static Color DarkBlue
  2451.     {
  2452.         get { return Color.FromArgb(9, 91, 153); }
  2453.     }
  2454.  
  2455.     public static Color White
  2456.     {
  2457.         get { return Color.White; }
  2458.     }
  2459.  
  2460.     public static Color Silver
  2461.     {
  2462.         get { return Color.FromArgb(211, 211, 211); }
  2463.     }
  2464.  
  2465.     public static Color LightSilver
  2466.     {
  2467.         get { return Color.FromArgb(241, 241, 241); }
  2468.     }
  2469.  
  2470.     public static Color LighterSilver
  2471.     {
  2472.         get { return Color.FromArgb(248, 248, 248); }
  2473.     }
  2474.  
  2475.     public static Color DarkGray
  2476.     {
  2477.         get { return Color.FromArgb(51, 51, 51); }
  2478.     }
  2479.  
  2480.     public static Color Gray
  2481.     {
  2482.         get { return Color.FromArgb(102, 102, 102); }
  2483.     }
  2484.  
  2485.     public static Color LightGray
  2486.     {
  2487.         get { return Color.FromArgb(198, 198, 198); }
  2488.     }
  2489.  
  2490.     public static Color LighterGray
  2491.     {
  2492.         get { return Color.FromArgb(233, 233, 233); }
  2493.     }
  2494.  
  2495. }
  2496.  
  2497. public sealed class Brushes
  2498. {
  2499.  
  2500.     public static SolidBrush Red
  2501.     {
  2502.         get { return new SolidBrush(Colors.Red); }
  2503.     }
  2504.  
  2505.     public static SolidBrush LightRed
  2506.     {
  2507.         get { return new SolidBrush(Colors.LightRed); }
  2508.     }
  2509.  
  2510.     public static SolidBrush DarkRed
  2511.     {
  2512.         get { return new SolidBrush(Colors.DarkRed); }
  2513.     }
  2514.  
  2515.     public static SolidBrush Blue
  2516.     {
  2517.         get { return new SolidBrush(Colors.Blue); }
  2518.     }
  2519.  
  2520.     public static SolidBrush LighterBlue
  2521.     {
  2522.         get { return new SolidBrush(Colors.LighterBlue); }
  2523.     }
  2524.  
  2525.     public static SolidBrush DarkBlue
  2526.     {
  2527.         get { return new SolidBrush(Colors.DarkBlue); }
  2528.     }
  2529.  
  2530.     public static SolidBrush White
  2531.     {
  2532.         get { return new SolidBrush(Colors.White); }
  2533.     }
  2534.  
  2535.     public static SolidBrush Silver
  2536.     {
  2537.         get { return new SolidBrush(Colors.Silver); }
  2538.     }
  2539.  
  2540.     public static SolidBrush LightSilver
  2541.     {
  2542.         get { return new SolidBrush(Colors.LightSilver); }
  2543.     }
  2544.  
  2545.     public static SolidBrush LighterSilver
  2546.     {
  2547.         get { return new SolidBrush(Colors.LighterSilver); }
  2548.     }
  2549.  
  2550.     public static SolidBrush DarkGray
  2551.     {
  2552.         get { return new SolidBrush(Colors.DarkGray); }
  2553.     }
  2554.  
  2555.     public static SolidBrush Gray
  2556.     {
  2557.         get { return new SolidBrush(Colors.Gray); }
  2558.     }
  2559.  
  2560.     public static SolidBrush LightGray
  2561.     {
  2562.         get { return new SolidBrush(Colors.LightGray); }
  2563.     }
  2564.  
  2565.     public static SolidBrush LighterGray
  2566.     {
  2567.         get { return new SolidBrush(Colors.LighterGray); }
  2568.     }
  2569.  
  2570. }
  2571.  
  2572. public sealed class Pens
  2573. {
  2574.  
  2575.     public static Pen Red
  2576.     {
  2577.         get { return new Pen(Colors.Red); }
  2578.     }
  2579.  
  2580.     public static Pen LightRed
  2581.     {
  2582.         get { return new Pen(Colors.LightRed); }
  2583.     }
  2584.  
  2585.     public static Pen DarkRed
  2586.     {
  2587.         get { return new Pen(Colors.DarkRed); }
  2588.     }
  2589.  
  2590.     public static Pen Blue
  2591.     {
  2592.         get { return new Pen(Colors.Blue); }
  2593.     }
  2594.  
  2595.     public static Pen LighterBlue
  2596.     {
  2597.         get { return new Pen(Colors.LighterBlue); }
  2598.     }
  2599.  
  2600.     public static Pen DarkBlue
  2601.     {
  2602.         get { return new Pen(Colors.DarkBlue); }
  2603.     }
  2604.  
  2605.     public static Pen White
  2606.     {
  2607.         get { return new Pen(Colors.White); }
  2608.     }
  2609.  
  2610.     public static Pen Silver
  2611.     {
  2612.         get { return new Pen(Colors.Silver); }
  2613.     }
  2614.  
  2615.     public static Pen LightSilver
  2616.     {
  2617.         get { return new Pen(Colors.Gray); }
  2618.     }
  2619.  
  2620.     public static Pen LighterSilver
  2621.     {
  2622.         get { return new Pen(Colors.LighterSilver); }
  2623.     }
  2624.  
  2625.     public static Pen DarkGray
  2626.     {
  2627.         get { return new Pen(Colors.DarkGray); }
  2628.     }
  2629.  
  2630.     public static Pen Gray
  2631.     {
  2632.         get { return new Pen(Colors.Gray); }
  2633.     }
  2634.  
  2635.     public static Pen LightGray
  2636.     {
  2637.         get { return new Pen(Colors.LightGray); }
  2638.     }
  2639.  
  2640.     public static Pen LighterGray
  2641.     {
  2642.         get { return new Pen(Colors.LighterGray); }
  2643.     }
  2644.  
  2645. }
  2646.  
  2647. #endregion
Add Comment
Please, Sign In to add comment