Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using Microsoft.VisualBasic.CompilerServices;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Drawing;
- using System.Drawing.Drawing2D;
- using System.Drawing.Text;
- using System.IO;
- using System.Runtime.CompilerServices;
- using System.Text;
- using System.Windows.Forms;
- namespace Theme
- {
- class VelocityTheme
- {
- public class VelocityToggle : Control
- {
- private static void __ENCAddToList(object value)
- {
- List<WeakReference> _ENCList = VelocityToggle.__ENCList;
- checked
- {
- lock (_ENCList)
- {
- bool flag = VelocityToggle.__ENCList.Count == VelocityToggle.__ENCList.Capacity;
- if (flag)
- {
- int num = 0;
- int arg_3F_0 = 0;
- int num2 = VelocityToggle.__ENCList.Count - 1;
- int num3 = arg_3F_0;
- while (true)
- {
- int arg_90_0 = num3;
- int num4 = num2;
- if (arg_90_0 > num4)
- {
- break;
- }
- WeakReference weakReference = VelocityToggle.__ENCList[num3];
- flag = weakReference.IsAlive;
- if (flag)
- {
- bool flag2 = num3 != num;
- if (flag2)
- {
- VelocityToggle.__ENCList[num] = VelocityToggle.__ENCList[num3];
- }
- num++;
- }
- num3++;
- }
- VelocityToggle.__ENCList.RemoveRange(num, VelocityToggle.__ENCList.Count - num);
- VelocityToggle.__ENCList.Capacity = VelocityToggle.__ENCList.Count;
- }
- VelocityToggle.__ENCList.Add(new WeakReference(RuntimeHelpers.GetObjectValue(value)));
- }
- }
- }
- public bool Checked
- {
- get
- {
- return this._checked;
- }
- set
- {
- this._checked = value;
- this.Invalidate();
- }
- }
- public VelocityToggle()
- {
- VelocityToggle.__ENCAddToList(this);
- this._checked = false;
- Size size = new Size(50, 23);
- this.Size = size;
- this.DoubleBuffered = true;
- }
- protected override void OnPaint(PaintEventArgs e)
- {
- base.OnPaint(e);
- Graphics g = e.Graphics;
- g.Clear(Helpers.FromHex("#435363"));
- checked
- {
- switch (this._checked)
- {
- case false:
- g.FillRectangle(new SolidBrush(Helpers.FromHex("#2c3e50")), 4, 4, 15, 15);
- break;
- case true:
- g.FillRectangle(Brushes.White, this.Width - 19, this.Height - 19, 15, 15);
- break;
- }
- }
- }
- protected override void OnMouseDown(MouseEventArgs e)
- {
- base.OnMouseDown(e);
- this._checked = !this._checked;
- this.Invalidate();
- }
- private static List<WeakReference> __ENCList = new List<WeakReference>();
- private bool _checked;
- }
- public class VelocityTitle : Control
- {
- private static void __ENCAddToList(object value)
- {
- List<WeakReference> _ENCList = VelocityTitle.__ENCList;
- checked
- {
- lock (_ENCList)
- {
- bool flag = VelocityTitle.__ENCList.Count == VelocityTitle.__ENCList.Capacity;
- if (flag)
- {
- int num = 0;
- int arg_3F_0 = 0;
- int num2 = VelocityTitle.__ENCList.Count - 1;
- int num3 = arg_3F_0;
- while (true)
- {
- int arg_90_0 = num3;
- int num4 = num2;
- if (arg_90_0 > num4)
- {
- break;
- }
- WeakReference weakReference = VelocityTitle.__ENCList[num3];
- flag = weakReference.IsAlive;
- if (flag)
- {
- bool flag2 = num3 != num;
- if (flag2)
- {
- VelocityTitle.__ENCList[num] = VelocityTitle.__ENCList[num3];
- }
- num++;
- }
- num3++;
- }
- VelocityTitle.__ENCList.RemoveRange(num, VelocityTitle.__ENCList.Count - num);
- VelocityTitle.__ENCList.Capacity = VelocityTitle.__ENCList.Count;
- }
- VelocityTitle.__ENCList.Add(new WeakReference(RuntimeHelpers.GetObjectValue(value)));
- }
- }
- }
- public Helpers.TxtAlign TextAlign
- {
- get
- {
- return this._txtAlign;
- }
- set
- {
- this._txtAlign = value;
- this.Invalidate();
- }
- }
- public VelocityTitle()
- {
- VelocityTitle.__ENCAddToList(this);
- this._txtAlign = Helpers.TxtAlign.Left;
- this.DoubleBuffered = true;
- Size size = new Size(180, 23);
- this.Size = size;
- }
- protected override void OnPaint(PaintEventArgs e)
- {
- base.OnPaint(e);
- Graphics g = e.Graphics;
- Graphics arg_67_0 = g;
- Pen arg_67_1 = new Pen(Helpers.FromHex("#435363"));
- checked
- {
- Point point = new Point(0, (int)Math.Round((double)this.Height / 2.0));
- Point arg_67_2 = point;
- Point pt = new Point(this.Width, (int)Math.Round((double)this.Height / 2.0));
- arg_67_0.DrawLine(arg_67_1, arg_67_2, pt);
- Size txtRect = new Size((Point)g.MeasureString(this.Text, this.Font).ToSize());
- switch (this._txtAlign)
- {
- case Helpers.TxtAlign.Left:
- {
- Graphics arg_138_0 = g;
- Brush arg_138_1 = new SolidBrush(this.BackColor);
- Rectangle rect = new Rectangle(18, (int)Math.Round(unchecked((double)this.Height / 2.0 - (double)txtRect.Height - 2.0)), txtRect.Width + 6, (int)Math.Round(unchecked((double)this.Height / 2.0 + (double)txtRect.Height / 2.0 + 6.0)));
- arg_138_0.FillRectangle(arg_138_1, rect);
- g.DrawString(this.Text, this.Font, new SolidBrush(this.ForeColor), 20f, (float)(unchecked((double)this.Height / 2.0 - (double)txtRect.Height / 2.0)));
- break;
- }
- case Helpers.TxtAlign.Center:
- {
- Graphics arg_21C_0 = g;
- Brush arg_21C_1 = new SolidBrush(this.BackColor);
- Rectangle rect = new Rectangle((int)Math.Round(unchecked((double)this.Width / 2.0 - (double)txtRect.Width / 2.0 - 2.0)), (int)Math.Round(unchecked((double)this.Height / 2.0 - (double)txtRect.Height / 2.0 - 2.0)), txtRect.Width + 2, txtRect.Height + 2);
- arg_21C_0.FillRectangle(arg_21C_1, rect);
- unchecked
- {
- g.DrawString(this.Text, this.Font, new SolidBrush(this.ForeColor), (float)((double)this.Width / 2.0 - (double)txtRect.Width / 2.0), (float)((double)this.Height / 2.0 - (double)txtRect.Height / 2.0));
- break;
- }
- }
- case Helpers.TxtAlign.Right:
- {
- Graphics arg_2F2_0 = g;
- Brush arg_2F2_1 = new SolidBrush(this.BackColor);
- Rectangle rect = new Rectangle(this.Width - (txtRect.Width + 18), (int)Math.Round(unchecked((double)this.Height / 2.0 - (double)txtRect.Height - 2.0)), txtRect.Width + 4, this.Height + 6);
- arg_2F2_0.FillRectangle(arg_2F2_1, rect);
- g.DrawString(this.Text, this.Font, new SolidBrush(this.ForeColor), (float)(this.Width - (txtRect.Width + 16)), (float)(unchecked((double)this.Height / 2.0 - (double)txtRect.Height / 2.0)));
- break;
- }
- }
- }
- }
- protected override void OnFontChanged(EventArgs e)
- {
- base.OnFontChanged(e);
- this.Invalidate();
- }
- protected override void OnTextChanged(EventArgs e)
- {
- base.OnTextChanged(e);
- this.Invalidate();
- }
- private static List<WeakReference> __ENCList = new List<WeakReference>();
- private Helpers.TxtAlign _txtAlign;
- }
- public class VelocityTag : Control
- {
- private static void __ENCAddToList(object value)
- {
- List<WeakReference> _ENCList = VelocityTag.__ENCList;
- checked
- {
- lock (_ENCList)
- {
- bool flag = VelocityTag.__ENCList.Count == VelocityTag.__ENCList.Capacity;
- if (flag)
- {
- int num = 0;
- int arg_3F_0 = 0;
- int num2 = VelocityTag.__ENCList.Count - 1;
- int num3 = arg_3F_0;
- while (true)
- {
- int arg_90_0 = num3;
- int num4 = num2;
- if (arg_90_0 > num4)
- {
- break;
- }
- WeakReference weakReference = VelocityTag.__ENCList[num3];
- flag = weakReference.IsAlive;
- if (flag)
- {
- bool flag2 = num3 != num;
- if (flag2)
- {
- VelocityTag.__ENCList[num] = VelocityTag.__ENCList[num3];
- }
- num++;
- }
- num3++;
- }
- VelocityTag.__ENCList.RemoveRange(num, VelocityTag.__ENCList.Count - num);
- VelocityTag.__ENCList.Capacity = VelocityTag.__ENCList.Count;
- }
- VelocityTag.__ENCList.Add(new WeakReference(RuntimeHelpers.GetObjectValue(value)));
- }
- }
- }
- public Color Border
- {
- get
- {
- return this._border;
- }
- set
- {
- this._border = value;
- this.Invalidate();
- }
- }
- public VelocityTag()
- {
- VelocityTag.__ENCAddToList(this);
- this._border = Helpers.FromHex("#2c3e50");
- this.DoubleBuffered = true;
- this.BackColor = Helpers.FromHex("#34495e");
- this.ForeColor = Color.White;
- }
- protected override void OnPaint(PaintEventArgs e)
- {
- base.OnPaint(e);
- Graphics g = e.Graphics;
- g.Clear(this.BackColor);
- checked
- {
- g.DrawRectangle(new Pen(this._border), 0, 0, this.Width - 1, this.Height - 1);
- Graphics arg_8C_0 = g;
- string arg_8C_1 = this.Text;
- Font arg_8C_2 = this.Font;
- Brush arg_8C_3 = new SolidBrush(this.ForeColor);
- Rectangle r = new Rectangle(0, 0, this.Width, this.Height);
- arg_8C_0.DrawString(arg_8C_1, arg_8C_2, arg_8C_3, r, new StringFormat
- {
- Alignment = StringAlignment.Center,
- LineAlignment = StringAlignment.Center
- });
- }
- }
- protected override void OnTextChanged(EventArgs e)
- {
- base.OnTextChanged(e);
- this.Invalidate();
- }
- private static List<WeakReference> __ENCList = new List<WeakReference>();
- private Color _border;
- }
- public class VelocityTabControl : TabControl
- {
- private static void __ENCAddToList(object value)
- {
- List<WeakReference> _ENCList = VelocityTabControl.__ENCList;
- checked
- {
- lock (_ENCList)
- {
- bool flag = VelocityTabControl.__ENCList.Count == VelocityTabControl.__ENCList.Capacity;
- if (flag)
- {
- int num = 0;
- int arg_3F_0 = 0;
- int num2 = VelocityTabControl.__ENCList.Count - 1;
- int num3 = arg_3F_0;
- while (true)
- {
- int arg_90_0 = num3;
- int num4 = num2;
- if (arg_90_0 > num4)
- {
- break;
- }
- WeakReference weakReference = VelocityTabControl.__ENCList[num3];
- flag = weakReference.IsAlive;
- if (flag)
- {
- bool flag2 = num3 != num;
- if (flag2)
- {
- VelocityTabControl.__ENCList[num] = VelocityTabControl.__ENCList[num3];
- }
- num++;
- }
- num3++;
- }
- VelocityTabControl.__ENCList.RemoveRange(num, VelocityTabControl.__ENCList.Count - num);
- VelocityTabControl.__ENCList.Capacity = VelocityTabControl.__ENCList.Count;
- }
- VelocityTabControl.__ENCList.Add(new WeakReference(RuntimeHelpers.GetObjectValue(value)));
- }
- }
- }
- public Helpers.TxtAlign TextAlign
- {
- get
- {
- return this._txtAlign;
- }
- set
- {
- this._txtAlign = value;
- this.Invalidate();
- }
- }
- public VelocityTabControl()
- {
- VelocityTabControl.__ENCAddToList(this);
- this._overtab = 0;
- this._txtAlign = Helpers.TxtAlign.Center;
- this.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
- this.DoubleBuffered = true;
- this.SizeMode = TabSizeMode.Fixed;
- Size itemSize = new Size(40, 130);
- this.ItemSize = itemSize;
- this.Alignment = TabAlignment.Left;
- this.Font = new Font("Segoe UI Semilight", 9f);
- }
- protected override void OnPaint(PaintEventArgs e)
- {
- base.OnPaint(e);
- Bitmap b = new Bitmap(this.Width, this.Height);
- Graphics g = Graphics.FromImage(b);
- g.Clear(Helpers.FromHex("#435363"));
- int arg_3E_0 = 0;
- checked
- {
- int num = this.TabCount - 1;
- int i = arg_3E_0;
- while (true)
- {
- int arg_209_0 = i;
- int num2 = num;
- if (arg_209_0 > num2)
- {
- break;
- }
- Rectangle tabRect = this.GetTabRect(i);
- bool flag = i == this.SelectedIndex;
- if (flag)
- {
- g.FillRectangle(new SolidBrush(Helpers.FromHex("#2c3e50")), tabRect);
- }
- else
- {
- flag = (i == this._overtab);
- if (flag)
- {
- g.FillRectangle(new SolidBrush(Helpers.FromHex("#435363")), tabRect);
- }
- else
- {
- g.FillRectangle(new SolidBrush(Helpers.FromHex("#38495A")), tabRect);
- }
- }
- switch (this._txtAlign)
- {
- case Helpers.TxtAlign.Left:
- {
- Graphics arg_13E_0 = g;
- string arg_13E_1 = this.TabPages[i].Text;
- Font arg_13E_2 = this.Font;
- Brush arg_13E_3 = Brushes.White;
- Rectangle r = new Rectangle(tabRect.X + 8, tabRect.Y, tabRect.Width, tabRect.Height);
- arg_13E_0.DrawString(arg_13E_1, arg_13E_2, arg_13E_3, r, new StringFormat
- {
- Alignment = StringAlignment.Near,
- LineAlignment = StringAlignment.Center
- });
- break;
- }
- case Helpers.TxtAlign.Center:
- g.DrawString(this.TabPages[i].Text, this.Font, Brushes.White, tabRect, new StringFormat
- {
- Alignment = StringAlignment.Center,
- LineAlignment = StringAlignment.Center
- });
- break;
- case Helpers.TxtAlign.Right:
- {
- Graphics arg_1F6_0 = g;
- string arg_1F6_1 = this.TabPages[i].Text;
- Font arg_1F6_2 = this.Font;
- Brush arg_1F6_3 = Brushes.White;
- Rectangle r = new Rectangle(tabRect.X - 8, tabRect.Y, tabRect.Width, tabRect.Height);
- arg_1F6_0.DrawString(arg_1F6_1, arg_1F6_2, arg_1F6_3, r, new StringFormat
- {
- Alignment = StringAlignment.Far,
- LineAlignment = StringAlignment.Center
- });
- break;
- }
- }
- i++;
- }
- NewLateBinding.LateCall(e.Graphics, null, "DrawImage", new object[]
- {
- RuntimeHelpers.GetObjectValue(b.Clone()),
- 0,
- 0
- }, null, null, null, true);
- g.Dispose();
- b.Dispose();
- }
- }
- protected override void OnMouseMove(MouseEventArgs e)
- {
- base.OnMouseMove(e);
- int arg_18_0 = 0;
- checked
- {
- int num = this.TabPages.Count - 1;
- int i = arg_18_0;
- while (true)
- {
- int arg_4E_0 = i;
- int num2 = num;
- if (arg_4E_0 > num2)
- {
- break;
- }
- bool flag = this.GetTabRect(i).Contains(e.Location);
- if (flag)
- {
- this._overtab = i;
- }
- this.Invalidate();
- i++;
- }
- }
- }
- private static List<WeakReference> __ENCList = new List<WeakReference>();
- private int _overtab;
- private Helpers.TxtAlign _txtAlign;
- }
- public class VelocitySplitter : Control
- {
- private static void __ENCAddToList(object value)
- {
- List<WeakReference> _ENCList = VelocitySplitter.__ENCList;
- checked
- {
- lock (_ENCList)
- {
- bool flag = VelocitySplitter.__ENCList.Count == VelocitySplitter.__ENCList.Capacity;
- if (flag)
- {
- int num = 0;
- int arg_3F_0 = 0;
- int num2 = VelocitySplitter.__ENCList.Count - 1;
- int num3 = arg_3F_0;
- while (true)
- {
- int arg_90_0 = num3;
- int num4 = num2;
- if (arg_90_0 > num4)
- {
- break;
- }
- WeakReference weakReference = VelocitySplitter.__ENCList[num3];
- flag = weakReference.IsAlive;
- if (flag)
- {
- bool flag2 = num3 != num;
- if (flag2)
- {
- VelocitySplitter.__ENCList[num] = VelocitySplitter.__ENCList[num3];
- }
- num++;
- }
- num3++;
- }
- VelocitySplitter.__ENCList.RemoveRange(num, VelocitySplitter.__ENCList.Count - num);
- VelocitySplitter.__ENCList.Capacity = VelocitySplitter.__ENCList.Count;
- }
- VelocitySplitter.__ENCList.Add(new WeakReference(RuntimeHelpers.GetObjectValue(value)));
- }
- }
- }
- public int Offset
- {
- get
- {
- return this._offset;
- }
- set
- {
- this._offset = value;
- this.Invalidate();
- }
- }
- public VelocitySplitter()
- {
- VelocitySplitter.__ENCAddToList(this);
- this._offset = 8;
- this.DoubleBuffered = true;
- }
- protected override void OnPaint(PaintEventArgs e)
- {
- base.OnPaint(e);
- Graphics g = e.Graphics;
- Graphics arg_83_0 = g;
- Pen arg_83_1 = new Pen(this.ForeColor);
- checked
- {
- Point point = new Point(this._offset, (int)Math.Round(unchecked((double)this.Height / 2.0 - 2.0)));
- Point arg_83_2 = point;
- Point pt = new Point(this.Width - this._offset, (int)Math.Round(unchecked((double)this.Height / 2.0 - 1.0)));
- arg_83_0.DrawLine(arg_83_1, arg_83_2, pt);
- }
- }
- private static List<WeakReference> __ENCList = new List<WeakReference>();
- private int _offset;
- }
- [DefaultEvent("CheckChanged")]
- public class VelocityRadioButton : Control
- {
- private static void __ENCAddToList(object value)
- {
- List<WeakReference> _ENCList = VelocityRadioButton.__ENCList;
- checked
- {
- lock (_ENCList)
- {
- bool flag = VelocityRadioButton.__ENCList.Count == VelocityRadioButton.__ENCList.Capacity;
- if (flag)
- {
- int num = 0;
- int arg_3F_0 = 0;
- int num2 = VelocityRadioButton.__ENCList.Count - 1;
- int num3 = arg_3F_0;
- while (true)
- {
- int arg_90_0 = num3;
- int num4 = num2;
- if (arg_90_0 > num4)
- {
- break;
- }
- WeakReference weakReference = VelocityRadioButton.__ENCList[num3];
- flag = weakReference.IsAlive;
- if (flag)
- {
- bool flag2 = num3 != num;
- if (flag2)
- {
- VelocityRadioButton.__ENCList[num] = VelocityRadioButton.__ENCList[num3];
- }
- num++;
- }
- num3++;
- }
- VelocityRadioButton.__ENCList.RemoveRange(num, VelocityRadioButton.__ENCList.Count - num);
- VelocityRadioButton.__ENCList.Capacity = VelocityRadioButton.__ENCList.Count;
- }
- VelocityRadioButton.__ENCList.Add(new WeakReference(RuntimeHelpers.GetObjectValue(value)));
- }
- }
- }
- public event VelocityRadioButton.CheckChangedEventHandler CheckChanged
- {
- [MethodImpl(MethodImplOptions.Synchronized)]
- add
- {
- this.CheckChangedEvent = (VelocityRadioButton.CheckChangedEventHandler)Delegate.Combine(this.CheckChangedEvent, value);
- }
- [MethodImpl(MethodImplOptions.Synchronized)]
- remove
- {
- this.CheckChangedEvent = (VelocityRadioButton.CheckChangedEventHandler)Delegate.Remove(this.CheckChangedEvent, value);
- }
- }
- public override bool AutoSize
- {
- get
- {
- return this._autoSize;
- }
- set
- {
- this._autoSize = value;
- this.Invalidate();
- }
- }
- public bool Checked
- {
- get
- {
- return this._checked;
- }
- set
- {
- this._checked = value;
- this.Invalidate();
- }
- }
- public VelocityRadioButton()
- {
- VelocityRadioButton.__ENCAddToList(this);
- this._autoSize = true;
- this._checked = false;
- this.DoubleBuffered = true;
- this.InvalidateControls();
- }
- protected override void OnPaint(PaintEventArgs e)
- {
- base.OnPaint(e);
- bool autoSize = this.AutoSize;
- bool flag = autoSize;
- if (flag)
- {
- Size size = new Size(checked(TextRenderer.MeasureText(this.Text, this.Font).Width + 24), this.Height);
- this.Size = size;
- }
- Graphics g = e.Graphics;
- g.SmoothingMode = SmoothingMode.HighQuality;
- Helpers.MouseState state = this._state;
- flag = (state == Helpers.MouseState.Hover);
- if (flag)
- {
- g.FillEllipse(new SolidBrush(Helpers.FromHex("#DBDBDB")), 4, 4, 14, 14);
- }
- else
- {
- g.FillEllipse(Brushes.White, 4, 4, 14, 14);
- }
- Graphics arg_C3_0 = g;
- Pen arg_C3_1 = new Pen(Helpers.FromHex("#435363"));
- Rectangle rectangle = new Rectangle(4, 4, 14, 14);
- arg_C3_0.DrawEllipse(arg_C3_1, rectangle);
- Graphics arg_111_0 = g;
- string arg_111_1 = this.Text;
- Font arg_111_2 = this.Font;
- Brush arg_111_3 = new SolidBrush(this.ForeColor);
- rectangle = new Rectangle(22, 0, this.Width, this.Height);
- arg_111_0.DrawString(arg_111_1, arg_111_2, arg_111_3, rectangle, new StringFormat
- {
- LineAlignment = StringAlignment.Center
- });
- flag = this._checked;
- if (flag)
- {
- g.FillEllipse(new SolidBrush(Helpers.FromHex("#435363")), 7, 7, 8, 8);
- }
- }
- private void InvalidateControls()
- {
- bool flag = !this.IsHandleCreated || !this._checked;
- if (!flag)
- {
- try
- {
- IEnumerator enumerator = this.Parent.Controls.GetEnumerator();
- while (enumerator.MoveNext())
- {
- Control C = (Control)enumerator.Current;
- flag = (C != this && C is VelocityRadioButton);
- if (flag)
- {
- ((VelocityRadioButton)C).Checked = false;
- this.Invalidate();
- }
- }
- }
- finally
- {
- IEnumerator enumerator =this.Parent.Controls.GetEnumerator();
- flag = (enumerator is IDisposable);
- if (flag)
- {
- (enumerator as IDisposable).Dispose();
- }
- }
- }
- }
- protected override void OnTextChanged(EventArgs e)
- {
- base.OnTextChanged(e);
- this.Invalidate();
- }
- protected override void OnMouseUp(MouseEventArgs e)
- {
- base.OnMouseUp(e);
- this._state = Helpers.MouseState.Hover;
- switch (this.Checked)
- {
- case false:
- this.Checked = true;
- break;
- case true:
- this.Checked = false;
- break;
- }
- this._state = Helpers.MouseState.Hover;
- this.InvalidateControls();
- }
- protected override void OnMouseHover(EventArgs e)
- {
- base.OnMouseHover(e);
- this._state = Helpers.MouseState.Hover;
- this.Invalidate();
- }
- protected override void OnMouseLeave(EventArgs e)
- {
- base.OnMouseLeave(e);
- this._state = Helpers.MouseState.None;
- this.Invalidate();
- }
- protected override void OnMouseDown(MouseEventArgs e)
- {
- base.OnMouseDown(e);
- this._state = Helpers.MouseState.None;
- this.Invalidate();
- }
- protected override void OnResize(EventArgs e)
- {
- base.OnResize(e);
- this.Invalidate();
- }
- private static List<WeakReference> __ENCList = new List<WeakReference>();
- private Helpers.MouseState _state;
- private VelocityRadioButton.CheckChangedEventHandler CheckChangedEvent;
- private bool _autoSize;
- private bool _checked;
- public delegate void CheckChangedEventHandler(object sender, EventArgs e);
- }
- public class VelocityProgressBar : Control
- {
- private static void __ENCAddToList(object value)
- {
- List<WeakReference> _ENCList = VelocityProgressBar.__ENCList;
- checked
- {
- lock (_ENCList)
- {
- bool flag = VelocityProgressBar.__ENCList.Count == VelocityProgressBar.__ENCList.Capacity;
- if (flag)
- {
- int num = 0;
- int arg_3F_0 = 0;
- int num2 = VelocityProgressBar.__ENCList.Count - 1;
- int num3 = arg_3F_0;
- while (true)
- {
- int arg_90_0 = num3;
- int num4 = num2;
- if (arg_90_0 > num4)
- {
- break;
- }
- WeakReference weakReference = VelocityProgressBar.__ENCList[num3];
- flag = weakReference.IsAlive;
- if (flag)
- {
- bool flag2 = num3 != num;
- if (flag2)
- {
- VelocityProgressBar.__ENCList[num] = VelocityProgressBar.__ENCList[num3];
- }
- num++;
- }
- num3++;
- }
- VelocityProgressBar.__ENCList.RemoveRange(num, VelocityProgressBar.__ENCList.Count - num);
- VelocityProgressBar.__ENCList.Capacity = VelocityProgressBar.__ENCList.Count;
- }
- VelocityProgressBar.__ENCList.Add(new WeakReference(RuntimeHelpers.GetObjectValue(value)));
- }
- }
- }
- public Color Border
- {
- get
- {
- return this._border;
- }
- set
- {
- this._border = value;
- this.Invalidate();
- }
- }
- public Color ProgressColor
- {
- get
- {
- return this._progressColor;
- }
- set
- {
- this._progressColor = value;
- this.Invalidate();
- }
- }
- public int Value
- {
- get
- {
- return this._val;
- }
- set
- {
- this._val = value;
- this.ValChanged();
- this.Invalidate();
- }
- }
- public int Min
- {
- get
- {
- return this._min;
- }
- set
- {
- this._min = value;
- this.Invalidate();
- }
- }
- public int Max
- {
- get
- {
- return this._max;
- }
- set
- {
- this._max = value;
- this.Invalidate();
- }
- }
- public bool ShowPercent
- {
- get
- {
- return this._showPercent;
- }
- set
- {
- this._showPercent = value;
- this.Invalidate();
- }
- }
- private void ValChanged()
- {
- bool flag = this._val > this._max;
- if (flag)
- {
- this._val = this._max;
- }
- }
- public VelocityProgressBar()
- {
- VelocityProgressBar.__ENCAddToList(this);
- this._border = Helpers.FromHex("#485e75");
- this._progressColor = Helpers.FromHex("#2c3e50");
- this._val = 0;
- this._min = 0;
- this._max = 100;
- this._showPercent = false;
- this.DoubleBuffered = true;
- }
- protected override void OnPaint(PaintEventArgs e)
- {
- base.OnPaint(e);
- Graphics g = e.Graphics;
- bool showPercent = this._showPercent;
- checked
- {
- if (showPercent)
- {
- g.FillRectangle(new SolidBrush(Helpers.FromHex("#506070")), 0, 0, this.Width - 35, this.Height - 1);
- Graphics arg_89_0 = g;
- Brush arg_89_1 = new SolidBrush(this._progressColor);
- Rectangle rect = new Rectangle(0, 0, (int)Math.Round((double)(this._val * (this.Width - 35)) / (double)(this._max - this._min)), this.Height);
- arg_89_0.FillRectangle(arg_89_1, rect);
- g.DrawRectangle(new Pen(Color.Black), 0, 0, this.Width - 35, this.Height - 1);
- g.DrawString(Conversions.ToString(this._val) + "%", this.Font, new SolidBrush(this.ForeColor), (float)(this.Width - 30), (float)(unchecked((double)this.Height / 2.0 - (double)(g.MeasureString(Conversions.ToString(this._val) + "%", this.Font).Height / 2f) - 1.0)));
- }
- else
- {
- g.Clear(Helpers.FromHex("#506070"));
- Graphics arg_19C_0 = g;
- Brush arg_19C_1 = new SolidBrush(this._progressColor);
- Rectangle rect = new Rectangle(0, 0, (int)Math.Round(unchecked(checked((double)((this._val - 0) * (this.Width - 0)) / (double)(this._max - this._min)) + 0.0)), this.Height);
- arg_19C_0.FillRectangle(arg_19C_1, rect);
- g.DrawRectangle(new Pen(Color.Black), 0, 0, this.Width - 1, this.Height - 1);
- }
- }
- }
- private static List<WeakReference> __ENCList = new List<WeakReference>();
- private Color _border;
- private Color _progressColor;
- private int _val;
- private int _min;
- private int _max;
- private bool _showPercent;
- }
- [DefaultEvent("CheckChanged")]
- public class VelocityCheckBox : Control
- {
- private static void __ENCAddToList(object value)
- {
- List<WeakReference> _ENCList = VelocityCheckBox.__ENCList;
- checked
- {
- lock (_ENCList)
- {
- bool flag = VelocityCheckBox.__ENCList.Count == VelocityCheckBox.__ENCList.Capacity;
- if (flag)
- {
- int num = 0;
- int arg_3F_0 = 0;
- int num2 = VelocityCheckBox.__ENCList.Count - 1;
- int num3 = arg_3F_0;
- while (true)
- {
- int arg_90_0 = num3;
- int num4 = num2;
- if (arg_90_0 > num4)
- {
- break;
- }
- WeakReference weakReference = VelocityCheckBox.__ENCList[num3];
- flag = weakReference.IsAlive;
- if (flag)
- {
- bool flag2 = num3 != num;
- if (flag2)
- {
- VelocityCheckBox.__ENCList[num] = VelocityCheckBox.__ENCList[num3];
- }
- num++;
- }
- num3++;
- }
- VelocityCheckBox.__ENCList.RemoveRange(num, VelocityCheckBox.__ENCList.Count - num);
- VelocityCheckBox.__ENCList.Capacity = VelocityCheckBox.__ENCList.Count;
- }
- VelocityCheckBox.__ENCList.Add(new WeakReference(RuntimeHelpers.GetObjectValue(value)));
- }
- }
- }
- public event VelocityCheckBox.CheckChangedEventHandler CheckChanged
- {
- [MethodImpl(MethodImplOptions.Synchronized)]
- add
- {
- this.CheckChangedEvent = (VelocityCheckBox.CheckChangedEventHandler)Delegate.Combine(this.CheckChangedEvent, value);
- }
- [MethodImpl(MethodImplOptions.Synchronized)]
- remove
- {
- this.CheckChangedEvent = (VelocityCheckBox.CheckChangedEventHandler)Delegate.Remove(this.CheckChangedEvent, value);
- }
- }
- public override bool AutoSize
- {
- get
- {
- return this._autoSize;
- }
- set
- {
- this._autoSize = value;
- this.Invalidate();
- }
- }
- public bool Checked
- {
- get
- {
- return this._checked;
- }
- set
- {
- this._checked = value;
- this.Invalidate();
- }
- }
- public VelocityCheckBox()
- {
- VelocityCheckBox.__ENCAddToList(this);
- this._state = Helpers.MouseState.None;
- this._autoSize = true;
- this._checked = false;
- this.DoubleBuffered = true;
- }
- protected override void OnPaint(PaintEventArgs e)
- {
- base.OnPaint(e);
- bool autoSize = this.AutoSize;
- bool flag = autoSize;
- if (flag)
- {
- Size size = new Size(checked(TextRenderer.MeasureText(this.Text, this.Font).Width + 28), this.Height);
- this.Size = size;
- }
- Graphics g = e.Graphics;
- Helpers.MouseState state = this._state;
- flag = (state == Helpers.MouseState.Hover);
- if (flag)
- {
- g.FillRectangle(new SolidBrush(Helpers.FromHex("#DBDBDB")), 4, 4, 14, 14);
- }
- else
- {
- g.FillRectangle(Brushes.White, 4, 4, 14, 14);
- }
- flag = this._checked;
- if (flag)
- {
- g.FillRectangle(new SolidBrush(Helpers.FromHex("#435363")), 7, 7, 9, 9);
- }
- Graphics arg_E4_0 = g;
- Pen arg_E4_1 = new Pen(Helpers.FromHex("#435363"));
- Rectangle rectangle = new Rectangle(4, 4, 14, 14);
- arg_E4_0.DrawRectangle(arg_E4_1, rectangle);
- Graphics arg_132_0 = g;
- string arg_132_1 = this.Text;
- Font arg_132_2 = this.Font;
- Brush arg_132_3 = new SolidBrush(this.ForeColor);
- rectangle = new Rectangle(22, 0, this.Width, this.Height);
- arg_132_0.DrawString(arg_132_1, arg_132_2, arg_132_3, rectangle, new StringFormat
- {
- LineAlignment = StringAlignment.Center
- });
- }
- protected override void OnTextChanged(EventArgs e)
- {
- base.OnTextChanged(e);
- this.Invalidate();
- }
- protected override void OnMouseUp(MouseEventArgs e)
- {
- base.OnMouseUp(e);
- switch (this.Checked)
- {
- case false:
- this.Checked = true;
- break;
- case true:
- this.Checked = false;
- break;
- }
- this._state = Helpers.MouseState.Hover;
- this.Invalidate();
- }
- protected override void OnMouseEnter(EventArgs e)
- {
- base.OnMouseEnter(e);
- this._state = Helpers.MouseState.Hover;
- this.Invalidate();
- }
- protected override void OnMouseHover(EventArgs e)
- {
- base.OnMouseHover(e);
- this._state = Helpers.MouseState.Hover;
- this.Invalidate();
- }
- protected override void OnMouseLeave(EventArgs e)
- {
- base.OnMouseLeave(e);
- this._state = Helpers.MouseState.None;
- this.Invalidate();
- }
- protected override void OnMouseDown(MouseEventArgs e)
- {
- base.OnMouseDown(e);
- this._state = Helpers.MouseState.Down;
- this.Invalidate();
- }
- protected override void OnResize(EventArgs e)
- {
- base.OnResize(e);
- this.Invalidate();
- }
- private static List<WeakReference> __ENCList = new List<WeakReference>();
- private Helpers.MouseState _state;
- private VelocityCheckBox.CheckChangedEventHandler CheckChangedEvent;
- private bool _autoSize;
- private bool _checked;
- public delegate void CheckChangedEventHandler(object sender, EventArgs e);
- }
- public class VelocityButton : Control
- {
- private static void __ENCAddToList(object value)
- {
- List<WeakReference> _ENCList = VelocityButton.__ENCList;
- checked
- {
- lock (_ENCList)
- {
- bool flag = VelocityButton.__ENCList.Count == VelocityButton.__ENCList.Capacity;
- if (flag)
- {
- int num = 0;
- int arg_3F_0 = 0;
- int num2 = VelocityButton.__ENCList.Count - 1;
- int num3 = arg_3F_0;
- while (true)
- {
- int arg_90_0 = num3;
- int num4 = num2;
- if (arg_90_0 > num4)
- {
- break;
- }
- WeakReference weakReference = VelocityButton.__ENCList[num3];
- flag = weakReference.IsAlive;
- if (flag)
- {
- bool flag2 = num3 != num;
- if (flag2)
- {
- VelocityButton.__ENCList[num] = VelocityButton.__ENCList[num3];
- }
- num++;
- }
- num3++;
- }
- VelocityButton.__ENCList.RemoveRange(num, VelocityButton.__ENCList.Count - num);
- VelocityButton.__ENCList.Capacity = VelocityButton.__ENCList.Count;
- }
- VelocityButton.__ENCList.Add(new WeakReference(RuntimeHelpers.GetObjectValue(value)));
- }
- }
- }
- public Helpers.TxtAlign TextAlign
- {
- get
- {
- return this._txtAlign;
- }
- set
- {
- this._txtAlign = value;
- this.Invalidate();
- }
- }
- public VelocityButton()
- {
- VelocityButton.__ENCAddToList(this);
- this.state = Helpers.MouseState.None;
- this._enabled = true;
- this._txtAlign = Helpers.TxtAlign.Center;
- this.DoubleBuffered = true;
- this.Font = new Font("Segoe UI Semilight", 9f);
- this.ForeColor = Color.White;
- Size size = new Size(94, 40);
- this.Size = size;
- }
- public new bool Enabled
- {
- get
- {
- return this._enabled;
- }
- set
- {
- this._enabled = value;
- this.Invalidate();
- }
- }
- public void PerformClick()
- {
- base.OnClick(EventArgs.Empty);
- }
- protected override void OnPaint(PaintEventArgs e)
- {
- base.OnPaint(e);
- Graphics g = e.Graphics;
- checked
- {
- switch (this._enabled)
- {
- case false:
- g.Clear(Helpers.FromHex("#38495A"));
- break;
- case true:
- switch (this.state)
- {
- case Helpers.MouseState.Hover:
- g.Clear(Helpers.FromHex("#38495A"));
- break;
- case Helpers.MouseState.Down:
- g.Clear(this.BackColor);
- g.FillRectangle(new SolidBrush(Helpers.FromHex("#2c3e50")), 1, 1, this.Width - 2, this.Height - 2);
- break;
- case Helpers.MouseState.None:
- g.Clear(Helpers.FromHex("#435363"));
- break;
- }
- break;
- }
- switch (this._txtAlign)
- {
- case Helpers.TxtAlign.Left:
- {
- Graphics arg_136_0 = g;
- string arg_136_1 = this.Text;
- Font arg_136_2 = this.Font;
- Brush arg_136_3 = new SolidBrush(this.ForeColor);
- Rectangle r = new Rectangle(8, 0, this.Width, this.Height);
- arg_136_0.DrawString(arg_136_1, arg_136_2, arg_136_3, r, new StringFormat
- {
- Alignment = StringAlignment.Near,
- LineAlignment = StringAlignment.Center
- });
- break;
- }
- case Helpers.TxtAlign.Center:
- {
- Graphics arg_192_0 = g;
- string arg_192_1 = this.Text;
- Font arg_192_2 = this.Font;
- Brush arg_192_3 = new SolidBrush(this.ForeColor);
- Rectangle r = new Rectangle(0, 0, this.Width, this.Height);
- arg_192_0.DrawString(arg_192_1, arg_192_2, arg_192_3, r, new StringFormat
- {
- Alignment = StringAlignment.Center,
- LineAlignment = StringAlignment.Center
- });
- break;
- }
- case Helpers.TxtAlign.Right:
- {
- Graphics arg_1ED_0 = g;
- string arg_1ED_1 = this.Text;
- Font arg_1ED_2 = this.Font;
- Brush arg_1ED_3 = new SolidBrush(this.ForeColor);
- Rectangle r = new Rectangle(0, 0, this.Width - 8, this.Height);
- arg_1ED_0.DrawString(arg_1ED_1, arg_1ED_2, arg_1ED_3, r, new StringFormat
- {
- Alignment = StringAlignment.Far,
- LineAlignment = StringAlignment.Center
- });
- break;
- }
- }
- }
- }
- protected override void OnMouseEnter(EventArgs e)
- {
- base.OnMouseEnter(e);
- this.state = Helpers.MouseState.Hover;
- this.Invalidate();
- }
- protected override void OnMouseHover(EventArgs e)
- {
- base.OnMouseHover(e);
- this.state = Helpers.MouseState.Hover;
- this.Invalidate();
- }
- protected override void OnMouseLeave(EventArgs e)
- {
- base.OnMouseLeave(e);
- this.state = Helpers.MouseState.None;
- this.Invalidate();
- }
- protected override void OnMouseDown(MouseEventArgs e)
- {
- base.OnMouseDown(e);
- this.state = Helpers.MouseState.Down;
- this.Invalidate();
- }
- protected override void OnMouseUp(MouseEventArgs e)
- {
- base.OnMouseUp(e);
- this.state = Helpers.MouseState.Hover;
- this.Invalidate();
- }
- protected override void OnTextChanged(EventArgs e)
- {
- base.OnTextChanged(e);
- this.Invalidate();
- }
- private static List<WeakReference> __ENCList = new List<WeakReference>();
- private Helpers.MouseState state;
- private bool _enabled;
- private Helpers.TxtAlign _txtAlign;
- }
- public class VelocityAlert : Control
- {
- private static void __ENCAddToList(object value)
- {
- List<WeakReference> _ENCList = VelocityAlert.__ENCList;
- checked
- {
- lock (_ENCList)
- {
- bool flag = VelocityAlert.__ENCList.Count == VelocityAlert.__ENCList.Capacity;
- if (flag)
- {
- int num = 0;
- int arg_3F_0 = 0;
- int num2 = VelocityAlert.__ENCList.Count - 1;
- int num3 = arg_3F_0;
- while (true)
- {
- int arg_90_0 = num3;
- int num4 = num2;
- if (arg_90_0 > num4)
- {
- break;
- }
- WeakReference weakReference = VelocityAlert.__ENCList[num3];
- flag = weakReference.IsAlive;
- if (flag)
- {
- bool flag2 = num3 != num;
- if (flag2)
- {
- VelocityAlert.__ENCList[num] = VelocityAlert.__ENCList[num3];
- }
- num++;
- }
- num3++;
- }
- VelocityAlert.__ENCList.RemoveRange(num, VelocityAlert.__ENCList.Count - num);
- VelocityAlert.__ENCList.Capacity = VelocityAlert.__ENCList.Count;
- }
- VelocityAlert.__ENCList.Add(new WeakReference(RuntimeHelpers.GetObjectValue(value)));
- }
- }
- }
- public event VelocityAlert.XClickedEventHandler XClicked
- {
- [MethodImpl(MethodImplOptions.Synchronized)]
- add
- {
- this.XClickedEvent = (VelocityAlert.XClickedEventHandler)Delegate.Combine(this.XClickedEvent, value);
- }
- [MethodImpl(MethodImplOptions.Synchronized)]
- remove
- {
- this.XClickedEvent = (VelocityAlert.XClickedEventHandler)Delegate.Remove(this.XClickedEvent, value);
- }
- }
- public bool XChangeCursor
- {
- get
- {
- return this._xChangeCursor;
- }
- set
- {
- this._xChangeCursor = value;
- this.Invalidate();
- }
- }
- public string Title
- {
- get
- {
- return this._title;
- }
- set
- {
- this._title = value;
- this.Invalidate();
- }
- }
- public bool ShowExit
- {
- get
- {
- return this._exitButton;
- }
- set
- {
- this._exitButton = value;
- this.Invalidate();
- }
- }
- public bool ShowImage
- {
- get
- {
- return this._showImage;
- }
- set
- {
- this._showImage = value;
- this.Invalidate();
- }
- }
- public Image Image
- {
- get
- {
- return this._image;
- }
- set
- {
- this._image = value;
- this.Invalidate();
- }
- }
- public Color Border
- {
- get
- {
- return this._border;
- }
- set
- {
- this._border = value;
- this.Invalidate();
- }
- }
- public VelocityAlert()
- {
- VelocityAlert.__ENCAddToList(this);
- this._xHover = false;
- this.FillerImage = "iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAAlC+aJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTM0A1t6AAADZUlEQVRoQ+2W2ytsYRjG9x85Cikpp1KORSkihITkyinkdCERm0wi3IiS5ELKIQkXkiQkh9m/tZ7PNHuwWi707dl9v4vpfd/1zut51ncYvyIpzv9iIJaCSLkzYA8pdwbsIeXOgD2k3Bmwh5Q7A/aQcmfAHlLuDNhDyp0Be0i5M2APKXcG7CHlzoA9pPx7Bh4fH4+Pj/f29m5vb03pHSpnZ2cmCeTt7Y1OhlxdXZnSO8/PzyGHgJR/w8Dc3Fx6err6s7OzTdXn9fW1sLCQ+urqqil9AQ15eXkaAkdHR+aBT21tLcWJiQmTB6IJYQ1sbW3RtrKyovTy8lKBGBsb05zl5WVT+ozT01N6pqenlSatwNLSkoaMjIyYUiBqDmugoaGhr6/PJH/DojNhf3+fz2g0SoXPqampu7s7Nfz2Iejt7W1sbFQxiaenJ1YG/wwZHBw01UA83eENsHnW1tZ4Z4eHh/f396bq09bW1tLSQpE5MgBFRUWdnZ0EJycn1Dc2NojLysrYHhhjSNIpGh4ezs/PJ6C5v79fxWA83SENXF9f01NVVaVmGBgY0KPNzU1SgiQDKCZlx1dUVHR0dKiYlZVVWlrqfd+nvb1ddS4G0ouLC2ICFkr1YPwZ4Qycn5/TMzQ0pHRmZoYU6cTl5eXaHkkGoLm52Rsdidzc3JBy+RC3trZqASV6dnaWmAXs6enxvvNDBlh0era3t00eixUUFKCb45iZmcnqj4+P6xwjJf5eFxYWqLACSiEnJ4erzCSxWF1dHedKa8W+ZwIbjJillrFg6ISwZyA3N3d+fl4xvwZpaWmsAAa6u7u7uro4Bk1NTcwpLi4uKSmhhy3OsRkdHaUY/2JNTU187wHNTMAAQwDnGsJhYKZp+hpPd3gD/IHq6moOw8vLC++JG4O73zzzeXh4YA4HXSn99fX1BLzajIwM7aLJyUl+Lg4ODogXFxfpZ3N63QmwpD9yjfJGWXE18+Z2d3fNg3cSDezs7BDHf1MrKytJFbNW3ohIhO20vr6uYiIsNXvJJIFoTlgDgs3DhW2SD3z8/+JTmJB0EScScghI+fcM/FNIuTNgDyl3Buwh5c6APaTcGbCHlDsD9pByZ8AeUu4M2EPKnQF7SLkzYA8pdwbsIeXOgD2k3Bmwh5QbA6lLihuIRP4AXubLj7lh8ksAAAAASUVORK5CYII=";
- this._xChangeCursor = true;
- this._title = this.Name;
- this._exitButton = false;
- this._showImage = true;
- this._border = Helpers.FromHex("#435363");
- Size size = new Size(370, 80);
- this.Size = size;
- this.DoubleBuffered = true;
- }
- protected override void OnPaint(PaintEventArgs e)
- {
- base.OnPaint(e);
- Graphics g = e.Graphics;
- g.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
- checked
- {
- bool flag;
- switch (this.ShowImage)
- {
- case false:
- {
- g.DrawString(this._title, new Font("Segoe UI Semilight", 14f), new SolidBrush(this.ForeColor), 18f, 6f);
- Graphics arg_153_0 = g;
- string arg_153_1 = this.Text;
- Font arg_153_2 = this.Font;
- Brush arg_153_3 = new SolidBrush(this.ForeColor);
- Rectangle r = new Rectangle(20, 33, this.Width - 28, this.Height - 10);
- arg_153_0.DrawString(arg_153_1, arg_153_2, arg_153_3, r);
- break;
- }
- case true:
- {
- flag = (this._image == null);
- if (flag)
- {
- g.DrawImage(Helpers.b64Image(this.FillerImage), 13, 8);
- }
- else
- {
- g.DrawImage(this._image, 12, 8, 64, 64);
- }
- g.DrawString(this._title, new Font("Segoe UI Semilight", 14f), new SolidBrush(this.ForeColor), 84f, 6f);
- Graphics arg_DD_0 = g;
- string arg_DD_1 = this.Text;
- Font arg_DD_2 = this.Font;
- Brush arg_DD_3 = new SolidBrush(this.ForeColor);
- Rectangle r = new Rectangle(86, 33, this.Width - 88, this.Height - 10);
- arg_DD_0.DrawString(arg_DD_1, arg_DD_2, arg_DD_3, r);
- break;
- }
- }
- flag = this.ShowExit;
- if (flag)
- {
- bool xHover = this._xHover;
- if (xHover)
- {
- g.DrawString("r", new Font("Marlett", 9f), new SolidBrush(Helpers.FromHex("#596372")), (float)(this.Width - 18), 4f);
- }
- else
- {
- g.DrawString("r", new Font("Marlett", 9f), new SolidBrush(Helpers.FromHex("#435363")), (float)(this.Width - 18), 4f);
- }
- }
- g.DrawRectangle(new Pen(this._border), 0, 0, this.Width - 1, this.Height - 1);
- g.FillRectangle(new SolidBrush(this._border), 0, 0, 6, this.Height);
- }
- }
- protected override void OnMouseMove(MouseEventArgs e)
- {
- base.OnMouseMove(e);
- bool exitButton = this._exitButton;
- if (exitButton)
- {
- Rectangle rectangle = new Rectangle(checked(this.Width - 16), 4, 12, 13);
- Rectangle rectangle2 = rectangle;
- bool flag = rectangle2.Contains(e.X, e.Y);
- if (flag)
- {
- this._xHover = true;
- flag = this._xChangeCursor;
- if (flag)
- {
- this.Cursor = Cursors.Hand;
- }
- }
- else
- {
- this._xHover = false;
- this.Cursor = Cursors.Default;
- }
- }
- this.Invalidate();
- }
- protected override void OnMouseUp(MouseEventArgs e)
- {
- base.OnMouseUp(e);
- bool exitButton = this._exitButton;
- if (exitButton)
- {
- bool flag = this._xHover;
- if (flag)
- {
- VelocityAlert.XClickedEventHandler xClickedEvent = this.XClickedEvent;
- flag = (xClickedEvent != null);
- if (flag)
- {
- xClickedEvent(this, EventArgs.Empty);
- }
- }
- }
- }
- protected override void OnTextChanged(EventArgs e)
- {
- base.OnTextChanged(e);
- this.Invalidate();
- }
- private static List<WeakReference> __ENCList = new List<WeakReference>();
- private VelocityAlert.XClickedEventHandler XClickedEvent;
- private bool _xHover;
- private string FillerImage;
- private bool _xChangeCursor;
- private string _title;
- private bool _exitButton;
- private bool _showImage;
- private Image _image;
- private Color _border;
- public delegate void XClickedEventHandler(object sender, EventArgs e);
- }
- public sealed class Helpers
- {
- public static Image b64Image(string b64)
- {
- return Image.FromStream(new MemoryStream(Convert.FromBase64String(b64)));
- }
- public static Color FromHex(string hex)
- {
- return ColorTranslator.FromHtml(hex);
- }
- public enum MouseState
- {
- Hover = 1,
- Down,
- None
- }
- public enum TxtAlign
- {
- Left = 1,
- Center,
- Right
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement