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.Diagnostics;
- using System.Drawing;
- using System.Drawing.Drawing2D;
- using System.Drawing.Text;
- using System.Linq;
- using System.Runtime.CompilerServices;
- using System.Text;
- using System.Threading;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace themesforcs
- {
- public enum MouseState : byte
- {
- None = 0,
- Hover = 1,
- Down = 2,
- Block = 3
- }
- [StandardModule]
- internal sealed class Functions
- {
- public static Point CenterText(string Text, Font Font, int Width, int Height)
- {
- checked
- {
- int x = (int)Math.Round(unchecked((double)Width / 2.0 - (double)TextRenderer.MeasureText(Text, Font).Width / 2.0));
- int y = (int)Math.Round(unchecked((double)Height / 2.0 - (double)TextRenderer.MeasureText(Text, Font).Height / 2.0));
- Point result = new Point(x, y);
- return result;
- }
- }
- public static Point LeftText(string Text, Font Font, int Width, int Height)
- {
- int x = 3;
- checked
- {
- int num = (int)Math.Round(unchecked((double)Height / 2.0 - (double)TextRenderer.MeasureText(Text, Font).Height / 2.0));
- Point result = new Point(x, num - 2);
- return result;
- }
- }
- public static LinearGradientBrush DrawGradient(int Width, int Height, MouseState State = MouseState.None)
- {
- bool flag = State == MouseState.None;
- LinearGradientBrush linearGradientBrush;
- if (flag)
- {
- linearGradientBrush = new LinearGradientBrush(new Point(0, Height), new Point(Width, Height), Color.FromArgb(255, 202, 18), Color.FromArgb(210, 160, 39));
- }
- else
- {
- bool flag2 = State == MouseState.Hover;
- if (flag2)
- {
- linearGradientBrush = new LinearGradientBrush(new Point(0, Height), new Point(Width, Height), Color.FromArgb(220, 255, 202, 18), Color.FromArgb(220, 210, 160, 39));
- }
- else
- {
- bool flag3 = State == MouseState.Down;
- if (flag3)
- {
- linearGradientBrush = new LinearGradientBrush(new Point(0, Height), new Point(Width, Height), Color.FromArgb(210, 160, 39), Color.FromArgb(255, 202, 18));
- }
- else
- {
- linearGradientBrush = new LinearGradientBrush(new Point(0, Height), new Point(Width, Height), Color.FromArgb(255, 202, 18), Color.FromArgb(210, 160, 39));
- }
- }
- }
- linearGradientBrush.RotateTransform(90f);
- return linearGradientBrush;
- }
- }
- internal class ColdForm : ContainerControl
- {
- private bool Down;
- private int MoveHeight;
- private Point MousePoint;
- public Font mFont;
- protected override void OnCreateControl()
- {
- base.ParentForm.FormBorderStyle = FormBorderStyle.None;
- base.ParentForm.AllowTransparency = true;
- base.ParentForm.TransparencyKey = Color.Fuchsia;
- this.Dock = DockStyle.Fill;
- base.Invalidate();
- }
- protected override void OnMouseDown(MouseEventArgs e)
- {
- base.OnMouseDown(e);
- bool flag = e.Button == MouseButtons.Left & new Rectangle(0, 0, base.Width, this.MoveHeight).Contains(e.Location);
- if (flag)
- {
- this.Down = true;
- this.MousePoint = e.Location;
- }
- }
- protected override void OnMouseUp(MouseEventArgs e)
- {
- base.OnMouseUp(e);
- this.Down = false;
- }
- protected override void OnMouseMove(MouseEventArgs e)
- {
- base.OnMouseMove(e);
- bool down = this.Down;
- if (down)
- {
- base.Parent.Location = Control.MousePosition - (Size)this.MousePoint;
- }
- }
- public ColdForm()
- {
- this.Down = false;
- this.MoveHeight = 30;
- this.MousePoint = new Point(0, 0);
- this.mFont = new Font("Segoe UI", 10f);
- this.Font = this.mFont;
- }
- protected override void OnPaint(PaintEventArgs e)
- {
- base.OnPaint(e);
- checked
- {
- using (Graphics graphics = e.Graphics)
- {
- graphics.Clear(Color.White);
- graphics.FillRectangle(Functions.DrawGradient(50, base.Height, MouseState.None), new Rectangle(new Point(0, 0), new Size(base.Width, 25)));
- graphics.FillRectangle(new SolidBrush(Color.FromArgb(218, 218, 218)), new Rectangle(0, 25, base.Width, base.Height - 25));
- graphics.DrawString(this.Text, this.mFont, new SolidBrush(Color.FromArgb(0, 0, 0)), Functions.LeftText(this.Text, this.mFont, base.Width, this.MoveHeight));
- graphics.DrawLine(Pens.Black, new Point(base.Width, 25), new Point(0, 25));
- graphics.DrawLine(Pens.Black, new Point(base.Width, 0), new Point(0, 0));
- graphics.DrawLine(Pens.Black, new Point(0, base.Height), new Point(0, 0));
- graphics.DrawLine(Pens.Black, new Point(base.Width - 1, 0), new Point(base.Width - 1, base.Height));
- graphics.DrawLine(Pens.Black, new Point(base.Width, base.Height - 1), new Point(0, base.Height - 1));
- }
- }
- }
- protected override void OnSizeChanged(EventArgs e)
- {
- base.OnSizeChanged(e);
- base.Refresh();
- }
- protected override void OnEnter(EventArgs e)
- {
- base.OnLocationChanged(e);
- }
- }
- [StandardModule]
- internal sealed class RoundRectangle
- {
- public static GraphicsPath RoundRect(Rectangle Rectangle, int Curve)
- {
- GraphicsPath graphicsPath = new GraphicsPath();
- checked
- {
- int num = Curve * 2;
- graphicsPath.AddArc(new Rectangle(Rectangle.X, Rectangle.Y, num, num), -180f, 90f);
- graphicsPath.AddArc(new Rectangle(Rectangle.Width - num + Rectangle.X, Rectangle.Y, num, num), -90f, 90f);
- graphicsPath.AddArc(new Rectangle(Rectangle.Width - num + Rectangle.X, Rectangle.Height - num + Rectangle.Y, num, num), 0f, 90f);
- graphicsPath.AddArc(new Rectangle(Rectangle.X, Rectangle.Height - num + Rectangle.Y, num, num), 90f, 90f);
- graphicsPath.AddLine(new Point(Rectangle.X, Rectangle.Height - num + Rectangle.Y), new Point(Rectangle.X, Curve + Rectangle.Y));
- return graphicsPath;
- }
- }
- public static GraphicsPath RoundRect(int X, int Y, int Width, int Height, int Curve)
- {
- Rectangle rectangle = new Rectangle(X, Y, Width, Height);
- GraphicsPath graphicsPath = new GraphicsPath();
- checked
- {
- int num = Curve * 2;
- graphicsPath.AddArc(new Rectangle(rectangle.X, rectangle.Y, num, num), -180f, 90f);
- graphicsPath.AddArc(new Rectangle(rectangle.Width - num + rectangle.X, rectangle.Y, num, num), -90f, 90f);
- graphicsPath.AddArc(new Rectangle(rectangle.Width - num + rectangle.X, rectangle.Height - num + rectangle.Y, num, num), 0f, 90f);
- graphicsPath.AddArc(new Rectangle(rectangle.X, rectangle.Height - num + rectangle.Y, num, num), 90f, 90f);
- graphicsPath.AddLine(new Point(rectangle.X, rectangle.Height - num + rectangle.Y), new Point(rectangle.X, Curve + rectangle.Y));
- return graphicsPath;
- }
- }
- public static GraphicsPath RoundedTopRect(Rectangle Rectangle, int Curve)
- {
- GraphicsPath graphicsPath = new GraphicsPath();
- checked
- {
- int num = Curve * 2;
- graphicsPath.AddArc(new Rectangle(Rectangle.X, Rectangle.Y, num, num), -180f, 90f);
- graphicsPath.AddArc(new Rectangle(Rectangle.Width - num + Rectangle.X, Rectangle.Y, num, num), -90f, 90f);
- graphicsPath.AddLine(new Point(Rectangle.X + Rectangle.Width, Rectangle.Y + num), new Point(Rectangle.X + Rectangle.Width, Rectangle.Y + Rectangle.Height - 1));
- graphicsPath.AddLine(new Point(Rectangle.X, Rectangle.Height - 1 + Rectangle.Y), new Point(Rectangle.X, Rectangle.Y + Curve));
- return graphicsPath;
- }
- }
- }
- [DefaultEvent("ValueChanged")]
- internal class ColdTrackBar : Control
- {
- public enum ValueDivisor
- {
- By1 = 1,
- By10 = 10,
- By100 = 100,
- By1000 = 1000
- }
- public delegate void ValueChangedEventHandler();
- private GraphicsPath PipeBorder;
- private GraphicsPath FillValue;
- private Rectangle TrackBarHandleRect;
- private bool Cap;
- private int ValueDrawer;
- private Size ThumbSize;
- private Rectangle TrackThumb;
- private int _Minimum;
- private int _Maximum;
- private int _Value;
- private bool _DrawValueString;
- private bool _JumpToMouse;
- private ColdTrackBar.ValueDivisor DividedValue;
- [DebuggerBrowsable(DebuggerBrowsableState.Never), CompilerGenerated]
- private ColdTrackBar.ValueChangedEventHandler ValueChangedEvent;
- public event ColdTrackBar.ValueChangedEventHandler ValueChanged
- {
- [CompilerGenerated]
- add
- {
- ColdTrackBar.ValueChangedEventHandler valueChangedEventHandler = this.ValueChangedEvent;
- ColdTrackBar.ValueChangedEventHandler valueChangedEventHandler2;
- do
- {
- valueChangedEventHandler2 = valueChangedEventHandler;
- ColdTrackBar.ValueChangedEventHandler value2 = (ColdTrackBar.ValueChangedEventHandler)Delegate.Combine(valueChangedEventHandler2, value);
- valueChangedEventHandler = Interlocked.CompareExchange<ColdTrackBar.ValueChangedEventHandler>(ref this.ValueChangedEvent, value2, valueChangedEventHandler2);
- }
- while (valueChangedEventHandler != valueChangedEventHandler2);
- }
- [CompilerGenerated]
- remove
- {
- ColdTrackBar.ValueChangedEventHandler valueChangedEventHandler = this.ValueChangedEvent;
- ColdTrackBar.ValueChangedEventHandler valueChangedEventHandler2;
- do
- {
- valueChangedEventHandler2 = valueChangedEventHandler;
- ColdTrackBar.ValueChangedEventHandler value2 = (ColdTrackBar.ValueChangedEventHandler)Delegate.Remove(valueChangedEventHandler2, value);
- valueChangedEventHandler = Interlocked.CompareExchange<ColdTrackBar.ValueChangedEventHandler>(ref this.ValueChangedEvent, value2, valueChangedEventHandler2);
- }
- while (valueChangedEventHandler != valueChangedEventHandler2);
- }
- }
- public int Minimum
- {
- get
- {
- return this._Minimum;
- }
- set
- {
- bool flag = value >= this._Maximum;
- if (flag)
- {
- value = checked(this._Maximum - 10);
- }
- bool flag2 = this._Value < value;
- if (flag2)
- {
- this._Value = value;
- }
- this._Minimum = value;
- base.Invalidate();
- }
- }
- public int Maximum
- {
- get
- {
- return this._Maximum;
- }
- set
- {
- bool flag = value <= this._Minimum;
- if (flag)
- {
- value = checked(this._Minimum + 10);
- }
- bool flag2 = this._Value > value;
- if (flag2)
- {
- this._Value = value;
- }
- this._Maximum = value;
- base.Invalidate();
- }
- }
- public int Value
- {
- get
- {
- return this._Value;
- }
- set
- {
- bool flag = this._Value != value;
- if (flag)
- {
- bool flag2 = value < this._Minimum;
- if (flag2)
- {
- this._Value = this._Minimum;
- }
- else
- {
- bool flag3 = value > this._Maximum;
- if (flag3)
- {
- this._Value = this._Maximum;
- }
- else
- {
- this._Value = value;
- }
- }
- base.Invalidate();
- ColdTrackBar.ValueChangedEventHandler valueChangedEvent = this.ValueChangedEvent;
- if (valueChangedEvent != null)
- {
- valueChangedEvent();
- }
- }
- }
- }
- public ColdTrackBar.ValueDivisor ValueDivison
- {
- get
- {
- return this.DividedValue;
- }
- set
- {
- this.DividedValue = value;
- base.Invalidate();
- }
- }
- [Browsable(false)]
- public float ValueToSet
- {
- get
- {
- return (float)((double)this._Value / (double)this.DividedValue);
- }
- set
- {
- this.Value = checked((int)Math.Round((double)unchecked(value * (float)this.DividedValue)));
- }
- }
- public bool JumpToMouse
- {
- get
- {
- return this._JumpToMouse;
- }
- set
- {
- this._JumpToMouse = value;
- base.Invalidate();
- }
- }
- public bool DrawValueString
- {
- get
- {
- return this._DrawValueString;
- }
- set
- {
- this._DrawValueString = value;
- bool drawValueString = this._DrawValueString;
- if (drawValueString)
- {
- base.Height = 35;
- }
- else
- {
- base.Height = 22;
- }
- base.Invalidate();
- }
- }
- protected override void OnMouseMove(MouseEventArgs e)
- {
- base.OnMouseMove(e);
- checked
- {
- bool flag = this.Cap && e.X > -1 && e.X < base.Width + 1;
- if (flag)
- {
- this.Value = this._Minimum + (int)Math.Round(unchecked((double)checked(this._Maximum - this._Minimum) * ((double)e.X / (double)base.Width)));
- }
- }
- }
- protected override void OnMouseDown(MouseEventArgs e)
- {
- base.OnMouseDown(e);
- bool flag = e.Button == MouseButtons.Left;
- checked
- {
- if (flag)
- {
- this.ValueDrawer = (int)Math.Round(unchecked(checked((double)(this._Value - this._Minimum) / (double)(this._Maximum - this._Minimum)) * (double)checked(base.Width - 11)));
- this.TrackBarHandleRect = new Rectangle(this.ValueDrawer, 0, 25, 25);
- this.Cap = this.TrackBarHandleRect.Contains(e.Location);
- base.Focus();
- bool jumpToMouse = this._JumpToMouse;
- if (jumpToMouse)
- {
- this.Value = this._Minimum + (int)Math.Round(unchecked((double)checked(this._Maximum - this._Minimum) * ((double)e.X / (double)base.Width)));
- }
- }
- }
- }
- protected override void OnMouseUp(MouseEventArgs e)
- {
- base.OnMouseUp(e);
- this.Cap = false;
- }
- public ColdTrackBar()
- {
- this.ThumbSize = new Size(15, 15);
- this._Minimum = 0;
- this._Maximum = 10;
- this._Value = 0;
- this._DrawValueString = false;
- this._JumpToMouse = false;
- this.DividedValue = ColdTrackBar.ValueDivisor.By1;
- base.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer, true);
- base.Size = new Size(80, 22);
- this.MinimumSize = new Size(47, 22);
- }
- protected override void OnResize(EventArgs e)
- {
- base.OnResize(e);
- bool drawValueString = this._DrawValueString;
- if (drawValueString)
- {
- base.Height = 35;
- }
- else
- {
- base.Height = 22;
- }
- }
- protected override void OnPaint(PaintEventArgs e)
- {
- base.OnPaint(e);
- Graphics graphics = e.Graphics;
- graphics.Clear(Color.FromArgb(218, 218, 218));
- graphics.SmoothingMode = SmoothingMode.AntiAlias;
- checked
- {
- this.TrackThumb = new Rectangle(8, 8, base.Width - 11, 2);
- this.PipeBorder = RoundRectangle.RoundRect(1, 8, base.Width - 3, 1, 1);
- try
- {
- this.ValueDrawer = (int)Math.Round(unchecked(checked((double)(this._Value - this._Minimum) / (double)(this._Maximum - this._Minimum)) * (double)checked(base.Width - 11)));
- }
- catch (Exception expr_98)
- {
- ProjectData.SetProjectError(expr_98);
- ProjectData.ClearProjectError();
- }
- this.TrackBarHandleRect = new Rectangle(this.ValueDrawer, 0, 10, 20);
- graphics.SetClip(this.PipeBorder);
- graphics.FillPath(new SolidBrush(Color.FromArgb(221, 221, 221)), this.PipeBorder);
- this.FillValue = RoundRectangle.RoundRect(0, 8, this.TrackBarHandleRect.X + this.TrackBarHandleRect.Width - 3, 2, 1);
- graphics.ResetClip();
- graphics.SmoothingMode = SmoothingMode.HighQuality;
- graphics.DrawPath(new Pen(Color.FromArgb(0, 0, 0)), this.PipeBorder);
- graphics.DrawRectangle(Pens.Black, this.TrackThumb.X + (int)Math.Round(unchecked((double)this.TrackThumb.Width * ((double)this.Value / (double)this.Maximum))) - (int)Math.Round((double)this.ThumbSize.Width / 2.0), this.TrackThumb.Y + (int)Math.Round((double)this.TrackThumb.Height / 2.0) - (int)Math.Round((double)this.ThumbSize.Height / 2.0), this.ThumbSize.Width - 6, this.ThumbSize.Height);
- graphics.FillRectangle(Functions.DrawGradient(this.ThumbSize.Width, this.ThumbSize.Height, MouseState.None), this.TrackThumb.X + (int)Math.Round(unchecked((double)this.TrackThumb.Width * ((double)this.Value / (double)this.Maximum))) - (int)Math.Round((double)this.ThumbSize.Width / 2.0), this.TrackThumb.Y + (int)Math.Round((double)this.TrackThumb.Height / 2.0) - (int)Math.Round((double)this.ThumbSize.Height / 2.0), this.ThumbSize.Width - 6, this.ThumbSize.Height);
- bool drawValueString = this._DrawValueString;
- if (drawValueString)
- {
- graphics.DrawString(Conversions.ToString(this.ValueToSet), this.Font, Brushes.DimGray, 1f, 20f);
- }
- }
- }
- }
- internal class ColdListBox : ListBox
- {
- private Font mFont;
- public GraphicsPath RoundRect(Rectangle rectangle, int curve)
- {
- GraphicsPath graphicsPath = new GraphicsPath();
- checked
- {
- int num = curve * 1;
- graphicsPath.AddArc(new Rectangle(rectangle.X, rectangle.Y, num, num), -180f, 90f);
- graphicsPath.AddArc(new Rectangle(rectangle.Width - num + rectangle.X, rectangle.Y, num, num), -90f, 90f);
- graphicsPath.AddArc(new Rectangle(rectangle.Width - num + rectangle.X, rectangle.Height - num + rectangle.Y, num, num), 0f, 90f);
- graphicsPath.AddArc(new Rectangle(rectangle.X, rectangle.Height - num + rectangle.Y, num, num), 90f, 90f);
- graphicsPath.AddLine(new Point(rectangle.X, rectangle.Height - num + rectangle.Y), new Point(rectangle.X, curve + rectangle.Y));
- return graphicsPath;
- }
- }
- public GraphicsPath RoundRect(int x, int y, int width, int height, int curve)
- {
- Rectangle rectangle = new Rectangle(x, y, width, height);
- GraphicsPath graphicsPath = new GraphicsPath();
- checked
- {
- int num = curve * 1;
- graphicsPath.AddArc(new Rectangle(rectangle.X, rectangle.Y, num, num), -180f, 90f);
- graphicsPath.AddArc(new Rectangle(rectangle.Width - num + rectangle.X, rectangle.Y, num, num), -90f, 90f);
- graphicsPath.AddArc(new Rectangle(rectangle.Width - num + rectangle.X, rectangle.Height - num + rectangle.Y, num, num), 0f, 90f);
- graphicsPath.AddArc(new Rectangle(rectangle.X, rectangle.Height - num + rectangle.Y, num, num), 90f, 90f);
- graphicsPath.AddLine(new Point(rectangle.X, rectangle.Height - num + rectangle.Y), new Point(rectangle.X, curve + rectangle.Y));
- return graphicsPath;
- }
- }
- protected override void OnCreateControl()
- {
- this.Dock = DockStyle.None;
- base.Invalidate();
- }
- public ColdListBox()
- {
- this.mFont = new Font("Segoe UI", 8f);
- base.SetStyle(ControlStyles.SupportsTransparentBackColor | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
- this.DoubleBuffered = true;
- this.DrawMode = DrawMode.OwnerDrawFixed;
- this.BackColor = Color.FromArgb(246, 246, 246);
- base.Width = 200;
- base.Height = 200;
- this.Font = this.mFont;
- this.ForeColor = Color.Black;
- this.ItemHeight = 20;
- base.BorderStyle = BorderStyle.FixedSingle;
- base.ScrollAlwaysVisible = false;
- base.HorizontalScrollbar = false;
- base.IntegralHeight = false;
- }
- protected override void OnPaint(PaintEventArgs e)
- {
- checked
- {
- using (Graphics graphics = e.Graphics)
- {
- graphics.SmoothingMode = SmoothingMode.HighQuality;
- graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;
- graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
- graphics.Clear(Color.FromArgb(246, 246, 246));
- graphics.DrawLine(Pens.Black, new Point(0, 0), new Point(base.Width, 0));
- graphics.DrawLine(Pens.Black, new Point(0, base.Height), new Point(0, 0));
- graphics.DrawLine(Pens.Black, new Point(base.Width + 1, 0), new Point(base.Width + 1, base.Height));
- graphics.DrawLine(Pens.Black, new Point(0, base.Height + 1), new Point(base.Width, base.Height + 1));
- graphics.Dispose();
- }
- base.OnPaint(e);
- e.Dispose();
- e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
- }
- }
- protected override void OnDrawItem(DrawItemEventArgs e)
- {
- checked
- {
- using (Graphics graphics = e.Graphics)
- {
- e.DrawBackground();
- e.DrawFocusRectangle();
- graphics.SmoothingMode = SmoothingMode.HighQuality;
- graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;
- graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
- graphics.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
- graphics.FillRectangle(new SolidBrush(this.BackColor), new Rectangle(e.Bounds.X, e.Bounds.Y - 1, e.Bounds.Width, e.Bounds.Height + 3));
- bool flag = e.State.ToString().Contains("Selected,");
- if (flag)
- {
- SolidBrush brush = new SolidBrush(Color.FromArgb(217, 219, 218));
- graphics.FillRectangle(brush, new Rectangle(e.Bounds.X, e.Bounds.Y + 1, e.Bounds.Width, e.Bounds.Height));
- graphics.DrawRectangle(new Pen(Color.FromArgb(212, 212, 212)), new Rectangle(e.Bounds.X, e.Bounds.Y + 1, e.Bounds.Width, e.Bounds.Height));
- }
- else
- {
- SolidBrush brush2 = new SolidBrush(Color.FromArgb(246, 246, 246));
- graphics.FillRectangle(brush2, e.Bounds);
- }
- try
- {
- graphics.DrawString(base.Items[e.Index].ToString(), this.mFont, new SolidBrush(Color.FromArgb(0, 0, 0)), new Rectangle(e.Bounds.X + 3, e.Bounds.Y + 5, e.Bounds.Width, e.Bounds.Height), new StringFormat
- {
- LineAlignment = StringAlignment.Near,
- Alignment = StringAlignment.Near,
- FormatFlags = StringFormatFlags.FitBlackBox
- });
- }
- catch (Exception arg_237_0)
- {
- ProjectData.SetProjectError(arg_237_0);
- ProjectData.ClearProjectError();
- }
- graphics.Dispose();
- }
- }
- }
- }
- internal class ColdButton : Control
- {
- private bool Down;
- private int MoveHeight;
- private Point MousePoint;
- private Font mFont;
- private bool isMouseEnter;
- private bool isMousePress;
- protected override void OnMouseDown(MouseEventArgs e)
- {
- this.isMousePress = true;
- this.Refresh();
- }
- protected override void OnMouseUp(MouseEventArgs e)
- {
- this.isMousePress = false;
- this.Refresh();
- }
- protected override void OnCreateControl()
- {
- this.Dock = DockStyle.None;
- base.Invalidate();
- }
- public ColdButton()
- {
- this.Down = false;
- this.MoveHeight = 30;
- this.MousePoint = new Point(0, 0);
- this.mFont = new Font("Segoe UI", 10f);
- this.isMouseEnter = false;
- this.isMousePress = false;
- this.BackColor = Color.FromArgb(51, 51, 51);
- base.Width = 100;
- base.Height = 30;
- this.Font = this.mFont;
- }
- protected override void OnPaint(PaintEventArgs e)
- {
- checked
- {
- using (Graphics graphics = e.Graphics)
- {
- graphics.Clear(Color.White);
- bool flag = !this.isMouseEnter & !this.isMousePress;
- if (flag)
- {
- graphics.FillRectangle(Functions.DrawGradient(base.Height, base.Width, MouseState.None), new Rectangle(new Point(0, 0), new Size(base.Width, base.Height)));
- }
- else
- {
- bool flag2 = this.isMousePress;
- if (flag2)
- {
- graphics.FillRectangle(Functions.DrawGradient(base.Height, base.Width, MouseState.Down), new Rectangle(new Point(0, 0), new Size(base.Width, base.Height)));
- }
- else
- {
- graphics.FillRectangle(Functions.DrawGradient(base.Height, base.Width, MouseState.Hover), new Rectangle(new Point(0, 0), new Size(base.Width, base.Height)));
- }
- }
- graphics.DrawLine(Pens.Black, new Point(0, 0), new Point(base.Width, 0));
- graphics.DrawLine(Pens.Black, new Point(0, base.Height), new Point(0, 0));
- graphics.DrawLine(Pens.Black, new Point(base.Width - 1, 0), new Point(base.Width - 1, base.Height));
- graphics.DrawLine(Pens.Black, new Point(0, base.Height - 1), new Point(base.Width, base.Height - 1));
- graphics.DrawString(this.Text, this.Font, Brushes.Black, new Point((Size)Functions.CenterText(this.Text, this.Font, base.Width, base.Height)));
- }
- }
- }
- protected override void OnMouseEnter(EventArgs e)
- {
- this.isMouseEnter = true;
- base.OnMouseEnter(e);
- this.Refresh();
- }
- protected override void OnMouseLeave(EventArgs e)
- {
- this.isMouseEnter = false;
- this.isMousePress = false;
- base.OnMouseEnter(e);
- this.Refresh();
- }
- protected override void OnSizeChanged(EventArgs e)
- {
- base.OnSizeChanged(e);
- base.Refresh();
- }
- }
- internal class ColdTabControl : TabControl
- {
- public ColdTabControl()
- {
- base.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer, true);
- base.ItemSize = new Size(0, 30);
- this.Font = new Font("Segoe UI", 8f);
- }
- protected override void CreateHandle()
- {
- base.CreateHandle();
- base.Alignment = TabAlignment.Top;
- }
- protected override void OnPaint(PaintEventArgs e)
- {
- Graphics graphics = e.Graphics;
- Pen pen = new Pen(Color.FromArgb(0, 0, 0));
- graphics.SmoothingMode = SmoothingMode.HighQuality;
- graphics.Clear(Color.FromArgb(218, 218, 218));
- checked
- {
- Rectangle rect = new Rectangle(2, base.ItemSize.Height + 2, base.Width - 6, base.Height - base.ItemSize.Height - 3);
- graphics.FillRectangle(new SolidBrush(Color.FromArgb(218, 218, 218)), rect);
- graphics.DrawRectangle(pen, rect);
- Color color = default(Color);
- int num = base.TabCount - 1;
- for (int i = 0; i <= num; i++)
- {
- Rectangle tabRect = base.GetTabRect(i);
- tabRect.Height -= 6;
- tabRect.Width -= 5;
- bool flag = i == base.SelectedIndex;
- if (flag)
- {
- graphics.FillRectangle(Functions.DrawGradient(tabRect.Height + 5, 0, MouseState.None), tabRect);
- graphics.DrawRectangle(pen, tabRect);
- color = Color.FromArgb(0, 0, 0);
- }
- else
- {
- graphics.FillRectangle(new SolidBrush(Color.FromArgb(218, 218, 218)), tabRect);
- graphics.DrawRectangle(pen, tabRect);
- color = Color.FromArgb(0, 0, 0);
- }
- int x = (int)Math.Round(unchecked((double)tabRect.Location.X + (double)tabRect.Width / 2.0 - (double)(graphics.MeasureString(base.TabPages[i].Text, this.Font).Width / 2f)));
- int y = (int)Math.Round(unchecked((double)tabRect.Location.Y + (double)tabRect.Height / 2.0 - (double)(graphics.MeasureString(base.TabPages[i].Text, this.Font).Height / 2f)));
- graphics.DrawString(base.TabPages[i].Text, this.Font, new SolidBrush(color), new Point(x, y));
- try
- {
- base.TabPages[i].BackColor = Color.FromArgb(218, 218, 218);
- }
- catch (Exception arg_26B_0)
- {
- ProjectData.SetProjectError(arg_26B_0);
- ProjectData.ClearProjectError();
- }
- }
- }
- }
- }
- [DefaultEvent("CheckedChanged")]
- internal class ColdCheckBox : Control
- {
- public delegate void CheckedChangedEventHandler(object sender);
- [DebuggerBrowsable(DebuggerBrowsableState.Never), CompilerGenerated]
- private ColdCheckBox.CheckedChangedEventHandler CheckedChangedEvent;
- private bool _checked;
- public event ColdCheckBox.CheckedChangedEventHandler CheckedChanged
- {
- [CompilerGenerated]
- add
- {
- ColdCheckBox.CheckedChangedEventHandler checkedChangedEventHandler = this.CheckedChangedEvent;
- ColdCheckBox.CheckedChangedEventHandler checkedChangedEventHandler2;
- do
- {
- checkedChangedEventHandler2 = checkedChangedEventHandler;
- ColdCheckBox.CheckedChangedEventHandler value2 = (ColdCheckBox.CheckedChangedEventHandler)Delegate.Combine(checkedChangedEventHandler2, value);
- checkedChangedEventHandler = Interlocked.CompareExchange<ColdCheckBox.CheckedChangedEventHandler>(ref this.CheckedChangedEvent, value2, checkedChangedEventHandler2);
- }
- while (checkedChangedEventHandler != checkedChangedEventHandler2);
- }
- [CompilerGenerated]
- remove
- {
- ColdCheckBox.CheckedChangedEventHandler checkedChangedEventHandler = this.CheckedChangedEvent;
- ColdCheckBox.CheckedChangedEventHandler checkedChangedEventHandler2;
- do
- {
- checkedChangedEventHandler2 = checkedChangedEventHandler;
- ColdCheckBox.CheckedChangedEventHandler value2 = (ColdCheckBox.CheckedChangedEventHandler)Delegate.Remove(checkedChangedEventHandler2, value);
- checkedChangedEventHandler = Interlocked.CompareExchange<ColdCheckBox.CheckedChangedEventHandler>(ref this.CheckedChangedEvent, value2, checkedChangedEventHandler2);
- }
- while (checkedChangedEventHandler != checkedChangedEventHandler2);
- }
- }
- public bool Checked
- {
- get
- {
- return this._checked;
- }
- set
- {
- this._checked = value;
- base.Invalidate();
- }
- }
- public ColdCheckBox()
- {
- base.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
- base.Size = new Size(140, 20);
- this.Font = new Font("Segoe UI", 8f);
- }
- protected override void OnPaint(PaintEventArgs e)
- {
- Graphics graphics = e.Graphics;
- graphics.SmoothingMode = SmoothingMode.HighQuality;
- graphics.Clear(base.Parent.BackColor);
- checked
- {
- Rectangle rect = new Rectangle(0, 0, base.Height, base.Height - 1);
- graphics.FillRectangle(Functions.DrawGradient(rect.Height + 5, 0, MouseState.None), rect);
- graphics.DrawRectangle(new Pen(Color.FromArgb(218, 218, 218)), rect);
- rect.Width = 15;
- rect.Height = 15;
- graphics.DrawLine(Pens.Black, new Point(0, 0), new Point(rect.Width, 0));
- graphics.DrawLine(Pens.Black, new Point(0, 0), new Point(0, rect.Height));
- graphics.DrawLine(Pens.Black, new Point(rect.Width, 0), new Point(rect.Width, rect.Height));
- graphics.DrawLine(Pens.Black, new Point(0, rect.Height), new Point(rect.Width, rect.Height));
- Pen pen = new Pen(Color.FromArgb(218, 218, 218));
- Pen pen2 = new Pen(Color.FromArgb(0, 0, 0));
- bool @checked = this._checked;
- if (@checked)
- {
- graphics.DrawString("a", new Font("Marlett", 13f), Brushes.Black, new Point(-3, -1));
- }
- int num = (int)Math.Round(unchecked((double)base.Height / 2.0 - (double)(graphics.MeasureString(this.Text, this.Font).Height / 2f)));
- graphics.DrawString(this.Text, this.Font, Brushes.Black, new Point(24, num + 1));
- base.Size = new Size((int)Math.Round((double)unchecked(28f + graphics.MeasureString(this.Text, this.Font).Width)), 16);
- }
- }
- protected override void OnMouseDown(MouseEventArgs e)
- {
- base.OnMouseDown(e);
- bool flag = e.Button == MouseButtons.Left;
- if (flag)
- {
- bool @checked = this._checked;
- if (@checked)
- {
- this._checked = false;
- }
- else
- {
- this._checked = true;
- }
- ColdCheckBox.CheckedChangedEventHandler checkedChangedEvent = this.CheckedChangedEvent;
- if (checkedChangedEvent != null)
- {
- checkedChangedEvent(this);
- }
- base.Invalidate();
- }
- }
- }
- internal class ColdComboBox : ComboBox
- {
- public ColdComboBox()
- {
- base.DrawItem += new DrawItemEventHandler(this.replaceItem);
- base.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.SupportsTransparentBackColor | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
- this.Font = new Font("Segoe UI", 7f);
- }
- protected override void CreateHandle()
- {
- base.CreateHandle();
- base.DrawMode = DrawMode.OwnerDrawFixed;
- base.DropDownStyle = ComboBoxStyle.DropDownList;
- this.DoubleBuffered = true;
- base.ItemHeight = 20;
- }
- protected override void OnPaint(PaintEventArgs e)
- {
- base.OnPaint(e);
- Graphics graphics = e.Graphics;
- graphics.SmoothingMode = SmoothingMode.HighQuality;
- graphics.Clear(base.Parent.BackColor);
- checked
- {
- Rectangle rect = new Rectangle(0, 0, base.Width - 1, base.Height - 1);
- graphics.FillRectangle(new SolidBrush(Color.FromArgb(246, 246, 246)), rect);
- graphics.DrawRectangle(new Pen(Color.FromArgb(246, 246, 246)), rect);
- Point[] points = new Point[]
- {
- new Point(base.Width - 14, 16),
- new Point(base.Width - 18, 10),
- new Point(base.Width - 10, 10)
- };
- graphics.FillPolygon(Brushes.Black, points);
- graphics.DrawLine(Pens.Black, new Point(0, 0), new Point(base.Width, 0));
- graphics.DrawLine(Pens.Black, new Point(0, 0), new Point(0, base.Height));
- graphics.DrawLine(Pens.Black, new Point(base.Width - 25, 0), new Point(base.Width - 25, base.Height));
- graphics.DrawLine(Pens.Black, new Point(base.Width - 1, 0), new Point(base.Width - 1, base.Height));
- graphics.DrawLine(Pens.Black, new Point(0, base.Height - 1), new Point(base.Width, base.Height - 1));
- try
- {
- bool flag = base.Items.Count > 0;
- if (flag)
- {
- bool flag2 = this.SelectedIndex != -1;
- if (flag2)
- {
- int x = 6;
- int y = (int)Math.Round(unchecked((double)checked(base.Height - 1) / 2.0 - (double)(graphics.MeasureString(Conversions.ToString(base.Items[this.SelectedIndex]), this.Font).Height / 2f) + 1.0));
- graphics.DrawString(Conversions.ToString(base.Items[this.SelectedIndex]), this.Font, Brushes.Black, new Point(x, y));
- }
- else
- {
- int x2 = 6;
- int y2 = (int)Math.Round(unchecked((double)checked(base.Height - 1) / 2.0 - (double)(graphics.MeasureString(Conversions.ToString(base.Items[0]), this.Font).Height / 2f) + 1.0));
- graphics.DrawString(Conversions.ToString(base.Items[0]), this.Font, Brushes.Black, new Point(x2, y2));
- }
- }
- }
- catch (Exception arg_2F4_0)
- {
- ProjectData.SetProjectError(arg_2F4_0);
- ProjectData.ClearProjectError();
- }
- }
- }
- public void replaceItem(object sender, DrawItemEventArgs e)
- {
- e.DrawBackground();
- Graphics graphics = e.Graphics;
- graphics.SmoothingMode = SmoothingMode.HighQuality;
- checked
- {
- Rectangle rect = new Rectangle(e.Bounds.X - 1, e.Bounds.Y - 1, e.Bounds.Width + 1, e.Bounds.Height + 1);
- try
- {
- bool flag = (e.State & DrawItemState.Selected) == DrawItemState.Selected;
- if (flag)
- {
- graphics.FillRectangle(new SolidBrush(Color.FromArgb(245, 246, 246, 246)), rect);
- graphics.DrawString(base.GetItemText(RuntimeHelpers.GetObjectValue(base.Items[e.Index])), this.Font, Brushes.Black, new Rectangle(e.Bounds.X + 6, e.Bounds.Y + 3, e.Bounds.Width, e.Bounds.Height));
- graphics.DrawRectangle(new Pen(Color.FromArgb(20, 160, 230)), rect);
- }
- else
- {
- graphics.FillRectangle(new SolidBrush(Color.FromArgb(246, 246, 246)), rect);
- graphics.DrawString(base.GetItemText(RuntimeHelpers.GetObjectValue(base.Items[e.Index])), this.Font, Brushes.Black, new Rectangle(e.Bounds.X + 6, e.Bounds.Y + 3, e.Bounds.Width, e.Bounds.Height));
- graphics.DrawRectangle(new Pen(Color.FromArgb(246, 246, 246)), rect);
- }
- }
- catch (Exception arg_1E9_0)
- {
- ProjectData.SetProjectError(arg_1E9_0);
- ProjectData.ClearProjectError();
- }
- }
- }
- protected override void OnSelectedItemChanged(EventArgs e)
- {
- base.OnSelectedItemChanged(e);
- base.Invalidate();
- }
- }
- [DefaultEvent("CheckedChanged")]
- internal class ColdRadioButton : Control
- {
- public delegate void CheckedChangedEventHandler(object sender);
- [DebuggerBrowsable(DebuggerBrowsableState.Never), CompilerGenerated]
- private ColdRadioButton.CheckedChangedEventHandler CheckedChangedEvent;
- private bool _checked;
- public event ColdRadioButton.CheckedChangedEventHandler CheckedChanged
- {
- [CompilerGenerated]
- add
- {
- ColdRadioButton.CheckedChangedEventHandler checkedChangedEventHandler = this.CheckedChangedEvent;
- ColdRadioButton.CheckedChangedEventHandler checkedChangedEventHandler2;
- do
- {
- checkedChangedEventHandler2 = checkedChangedEventHandler;
- ColdRadioButton.CheckedChangedEventHandler value2 = (ColdRadioButton.CheckedChangedEventHandler)Delegate.Combine(checkedChangedEventHandler2, value);
- checkedChangedEventHandler = Interlocked.CompareExchange<ColdRadioButton.CheckedChangedEventHandler>(ref this.CheckedChangedEvent, value2, checkedChangedEventHandler2);
- }
- while (checkedChangedEventHandler != checkedChangedEventHandler2);
- }
- [CompilerGenerated]
- remove
- {
- ColdRadioButton.CheckedChangedEventHandler checkedChangedEventHandler = this.CheckedChangedEvent;
- ColdRadioButton.CheckedChangedEventHandler checkedChangedEventHandler2;
- do
- {
- checkedChangedEventHandler2 = checkedChangedEventHandler;
- ColdRadioButton.CheckedChangedEventHandler value2 = (ColdRadioButton.CheckedChangedEventHandler)Delegate.Remove(checkedChangedEventHandler2, value);
- checkedChangedEventHandler = Interlocked.CompareExchange<ColdRadioButton.CheckedChangedEventHandler>(ref this.CheckedChangedEvent, value2, checkedChangedEventHandler2);
- }
- while (checkedChangedEventHandler != checkedChangedEventHandler2);
- }
- }
- public bool Checked
- {
- get
- {
- return this._checked;
- }
- set
- {
- this._checked = value;
- base.Invalidate();
- }
- }
- public ColdRadioButton()
- {
- base.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
- base.Size = new Size(140, 20);
- this.Font = new Font("Segoe UI", 8f);
- }
- protected override void OnPaint(PaintEventArgs e)
- {
- Graphics graphics = e.Graphics;
- graphics.SmoothingMode = SmoothingMode.HighQuality;
- graphics.Clear(base.Parent.BackColor);
- checked
- {
- Rectangle rect = new Rectangle(0, 0, base.Height - 5, base.Height - 5);
- graphics.FillEllipse(new SolidBrush(Color.FromArgb(235, 235, 235)), rect);
- graphics.DrawEllipse(new Pen(Color.FromArgb(0, 0, 0)), rect);
- bool @checked = this._checked;
- if (@checked)
- {
- Rectangle rect2 = new Rectangle(1, 1, base.Height - 7, base.Height - 7);
- graphics.FillEllipse(Functions.DrawGradient(20, 5, MouseState.None), rect2);
- }
- int num = (int)Math.Round(unchecked((double)base.Height / 2.0 - (double)(graphics.MeasureString(this.Text, this.Font).Height / 2f)));
- graphics.DrawString(this.Text, this.Font, Brushes.Black, new Point(20, num - 1));
- base.Size = new Size((int)Math.Round((double)unchecked(26f + graphics.MeasureString(this.Text, this.Font).Width)), 18);
- }
- }
- protected override void OnMouseDown(MouseEventArgs e)
- {
- base.OnMouseDown(e);
- bool flag = e.Button == MouseButtons.Left;
- if (flag)
- {
- try
- {
- IEnumerator enumerator = base.Parent.Controls.GetEnumerator();
- while (enumerator.MoveNext())
- {
- Control control = (Control)enumerator.Current;
- bool flag2 = control != this && control is ColdRadioButton;
- if (flag2)
- {
- ((ColdRadioButton)control).Checked = false;
- }
- }
- }
- finally
- {
- IEnumerator enumerator = null;
- if (enumerator is IDisposable)
- {
- (enumerator as IDisposable).Dispose();
- }
- }
- bool flag3 = !this._checked;
- if (flag3)
- {
- this._checked = true;
- }
- ColdRadioButton.CheckedChangedEventHandler checkedChangedEvent = this.CheckedChangedEvent;
- if (checkedChangedEvent != null)
- {
- checkedChangedEvent(this);
- }
- base.Invalidate();
- }
- }
- }
- internal class ColdGroupBox : GroupBox
- {
- public ColdGroupBox()
- {
- this.BackColor = Color.FromArgb(218, 218, 218);
- }
- protected override void OnPaint(PaintEventArgs e)
- {
- base.OnPaint(e);
- using (Graphics graphics = e.Graphics)
- {
- graphics.Clear(Color.FromArgb(218, 218, 218));
- graphics.DrawLine(Pens.Black, new Point(0, 0), new Point(0, 0));
- Rectangle rect = new Rectangle(new Point(0, 0), checked(new Size(base.Width - 1, base.Height - 1)));
- Rectangle rect2 = new Rectangle(new Point(0, 0), new Size(base.Width, 25));
- graphics.FillRectangle(Functions.DrawGradient(40, 25, MouseState.None), rect2);
- graphics.DrawRectangle(Pens.Black, rect);
- graphics.DrawString(this.Text, this.Font, Brushes.Black, Functions.CenterText(this.Text, this.Font, base.Width, 25));
- graphics.DrawLine(Pens.Black, new Point(0, 25), new Point(base.Width, 25));
- }
- }
- }
- internal class ColdLabel : Control
- {
- protected override void OnPaint(PaintEventArgs e)
- {
- base.OnPaint(e);
- checked
- {
- using (Graphics graphics = e.Graphics)
- {
- graphics.Clear(Color.FromArgb(216, 216, 216));
- graphics.DrawString(this.Text, this.Font, Brushes.Black, new Point(0, 0));
- base.Height = (int)Math.Round((double)graphics.MeasureString(this.Text, this.Font, base.Width).Height);
- base.Width = (int)Math.Round((double)graphics.MeasureString(this.Text, this.Font, base.Width).Width);
- }
- }
- }
- }
- [DefaultEvent("TextChanged")]
- internal class ColdTextBox : TextBox
- {
- protected override void OnCreateControl()
- {
- base.OnCreateControl();
- }
- public ColdTextBox()
- {
- base.BorderStyle = BorderStyle.FixedSingle;
- this.BackColor = Color.FromArgb(216, 216, 216);
- base.Margin = new Padding(5, 0, 0, 0);
- this.Font = new Font("Segoe UI", 8f);
- }
- protected override void OnPaint(PaintEventArgs e)
- {
- checked
- {
- using (Graphics graphics = e.Graphics)
- {
- graphics.DrawLine(Pens.Black, new Point(0, 0), new Point(base.Width, 0));
- graphics.DrawLine(Pens.Black, new Point(0, base.Height), new Point(0, 0));
- graphics.DrawLine(Pens.Black, new Point(base.Width - 1, 0), new Point(base.Width - 1, base.Height));
- graphics.DrawLine(Pens.Black, new Point(0, base.Height - 1), new Point(base.Width, base.Height - 1));
- }
- base.OnPaint(e);
- }
- }
- }
- internal class ColdProgressBar : Control
- {
- private int _Maximum;
- private bool _ShowPercant;
- private int _Minimum;
- private int _Value;
- public bool ShowPercant
- {
- get
- {
- return this._ShowPercant;
- }
- set
- {
- this._ShowPercant = value;
- base.Invalidate();
- }
- }
- public int Maximum
- {
- get
- {
- return this._Maximum;
- }
- set
- {
- bool flag = value < 1;
- if (flag)
- {
- value = 1;
- }
- bool flag2 = value < this._Value;
- if (flag2)
- {
- this._Value = value;
- }
- this._Maximum = value;
- base.Invalidate();
- }
- }
- public int Minimum
- {
- get
- {
- return this._Minimum;
- }
- set
- {
- bool flag = value <= -1;
- if (flag)
- {
- value = 0;
- }
- bool flag2 = value > this._Maximum;
- if (flag2)
- {
- value = checked(this._Maximum - 1);
- }
- this._Minimum = value;
- base.Invalidate();
- }
- }
- public int Value
- {
- get
- {
- return this._Value;
- }
- set
- {
- bool flag = value > this._Maximum;
- if (flag)
- {
- value = this.Maximum;
- }
- this._Value = value;
- base.Invalidate();
- }
- }
- public ColdProgressBar()
- {
- this._Maximum = 100;
- this._ShowPercant = true;
- this._Minimum = 0;
- base.SetStyle(ControlStyles.UserPaint | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
- base.Size = new Size(100, 24);
- this.Maximum = 100;
- this.Minimum = 0;
- this.Text = "";
- this.Font = new Font("Segoe UI", 8f);
- }
- protected override void OnPaint(PaintEventArgs e)
- {
- base.OnPaint(e);
- string text = this.Text;
- this.Text = "";
- Graphics graphics = e.Graphics;
- graphics.SmoothingMode = SmoothingMode.HighQuality;
- graphics.Clear(base.Parent.BackColor);
- checked
- {
- Rectangle rect = new Rectangle(0, 0, base.Width - 1, base.Height - 1);
- graphics.FillRectangle(new SolidBrush(Color.FromArgb(235, 235, 235)), rect);
- graphics.DrawRectangle(Pens.Black, rect);
- Rectangle rect2 = new Rectangle(0, 0, (int)Math.Round(unchecked((double)base.Width / (double)this._Maximum * (double)this._Value - 1.0)), base.Height - 1);
- graphics.FillRectangle(Functions.DrawGradient(base.Height, (int)Math.Round(unchecked((double)base.Width / (double)this._Maximum * (double)this._Value - 1.0)), MouseState.None), rect2);
- float value = (float)unchecked((double)this._Value / (double)this._Maximum * 100.0);
- string s = this.Text + " " + Conversions.ToString(value) + "%";
- bool showPercant = this.ShowPercant;
- if (showPercant)
- {
- graphics.DrawString(s, this.Font, Brushes.Black, Functions.LeftText(this.Text, this.Font, base.Width, (int)Math.Round(unchecked((double)base.Height / 2.0 - 1.0))));
- }
- else
- {
- graphics.DrawString(text, this.Font, Brushes.Black, Functions.CenterText(this.Text, this.Font, base.Width, (int)Math.Round(unchecked((double)base.Height / 2.0 - 3.0))));
- }
- this.Text = text;
- }
- }
- }
- class Class2
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement