Skip to content

Commit 2d1463e

Browse files
committed
Code clean up
1 parent 2d51941 commit 2d1463e

File tree

2 files changed

+31
-43
lines changed

2 files changed

+31
-43
lines changed

PlsqlDeveloperUtPlsqlPlugin/ColorProgressBar/ColorProgressBar.cs

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,16 @@ public class ColorProgressBar : System.Windows.Forms.Control
1616
private int _Maximum = 100;
1717
private int _Step = 10;
1818

19-
private Color _BarColor = Color.FromArgb(255, 128, 128);
19+
private Color _BarColor = Color.Green;
2020
private Color _BorderColor = Color.Black;
2121

22-
public enum FillStyles
23-
{
24-
Solid,
25-
Dashed
26-
}
27-
2822
public ColorProgressBar()
2923
{
30-
base.Size = new Size(150, 15);
24+
base.Size = new Size(200, 20);
3125
SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.DoubleBuffer, true);
3226
}
3327

34-
[Description("ColorProgressBar color")]
28+
[Description("Progress bar color")]
3529
[Category("ColorProgressBar")]
3630
public Color BarColor
3731
{
@@ -46,7 +40,7 @@ public Color BarColor
4640
}
4741
}
4842

49-
[Description("The current value for the ColorProgressBar, in the range specified by the Minimum and Maximum properties.")]
43+
[Description("The current value for the progres bar. Must be between Minimum and Maximum.")]
5044
[Category("ColorProgressBar")]
5145
[RefreshProperties(RefreshProperties.All)]
5246
public int Value
@@ -59,22 +53,20 @@ public int Value
5953
{
6054
if (value < _Minimum)
6155
{
62-
throw new ArgumentException("'" + value + "' is not a valid value for 'Value'.\n" +
63-
"'Value' must be between 'Minimum' and 'Maximum'.");
56+
throw new ArgumentException($"'{value}' is not a valid 'Value'.\n'Value' must be between 'Minimum' and 'Maximum'.");
6457
}
6558

6659
if (value > _Maximum)
6760
{
68-
throw new ArgumentException("'" + value + "' is not a valid value for 'Value'.\n" +
69-
"'Value' must be between 'Minimum' and 'Maximum'.");
61+
throw new ArgumentException($"'{value}' is not a valid 'Value'.\n'Value' must be between 'Minimum' and 'Maximum'.");
7062
}
7163

7264
_Value = value;
7365
this.Invalidate();
7466
}
7567
}
7668

77-
[Description("The lower bound of the range this ColorProgressbar is working with.")]
69+
[Description("The lower bound of the range.")]
7870
[Category("ColorProgressBar")]
7971
[RefreshProperties(RefreshProperties.All)]
8072
public int Minimum
@@ -96,7 +88,7 @@ public int Minimum
9688
}
9789
}
9890

99-
[Description("The uppper bound of the range this ColorProgressbar is working with.")]
91+
[Description("The uppper bound of the range.")]
10092
[Category("ColorProgressBar")]
10193
[RefreshProperties(RefreshProperties.All)]
10294
public int Maximum
@@ -118,7 +110,7 @@ public int Maximum
118110
}
119111
}
120112

121-
[Description("The amount to jump the current value of the control by when the Step() method is called.")]
113+
[Description("The value to move the progess bar when the Step() method is called.")]
122114
[Category("ColorProgressBar")]
123115
public int Step
124116
{
@@ -133,7 +125,7 @@ public int Step
133125
}
134126
}
135127

136-
[Description("The border color of ColorProgressBar")]
128+
[Description("The border color")]
137129
[Category("ColorProgressBar")]
138130
public Color BorderColor
139131
{
@@ -149,7 +141,7 @@ public Color BorderColor
149141
}
150142

151143
///
152-
/// <summary>Call the PerformStep() method to increase the value displayed by the amount set in the Step property</summary>
144+
/// <summary>Call the PerformStep() method to increase the value displayed by the value set in the Step property</summary>
153145
///
154146
public void PerformStep()
155147
{
@@ -162,7 +154,7 @@ public void PerformStep()
162154
}
163155

164156
///
165-
/// <summary>Call the PerformStepBack() method to decrease the value displayed by the amount set in the Step property</summary>
157+
/// <summary>Call the PerformStepBack() method to decrease the value displayed by the value set in the Step property</summary>
166158
///
167159
public void PerformStepBack()
168160
{
@@ -175,7 +167,7 @@ public void PerformStepBack()
175167
}
176168

177169
///
178-
/// <summary>Call the Increment() method to increase the value displayed by an integer you specify</summary>
170+
/// <summary>Call the Increment() method to increase the value displayed by the passed value</summary>
179171
///
180172
public void Increment(int value)
181173
{
@@ -188,7 +180,7 @@ public void Increment(int value)
188180
}
189181

190182
//
191-
// <summary>Call the Decrement() method to decrease the value displayed by an integer you specify</summary>
183+
// <summary>Call the Decrement() method to decrease the value displayed by the passed value</summary>
192184
//
193185
public void Decrement(int value)
194186
{
@@ -236,8 +228,7 @@ protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
236228

237229
protected void DrawBorder(Graphics g)
238230
{
239-
Rectangle borderRect = new Rectangle(0, 0,
240-
ClientRectangle.Width - 1, ClientRectangle.Height - 1);
231+
Rectangle borderRect = new Rectangle(0, 0, ClientRectangle.Width - 1, ClientRectangle.Height - 1);
241232
g.DrawRectangle(new Pen(_BorderColor, 1), borderRect);
242233
}
243234
}

PlsqlDeveloperUtPlsqlPlugin/ColorProgressBar/ColorProgressBarDesigner.cs

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,20 @@
33
namespace ColorProgressBar
44
{
55
internal class ColorProgressBarDesigner : System.Windows.Forms.Design.ControlDesigner
6-
{
7-
public ColorProgressBarDesigner()
8-
{}
9-
10-
/// <summary>Clean up some unnecessary properties</summary>
11-
protected override void PostFilterProperties(IDictionary Properties)
12-
{
13-
Properties.Remove("AllowDrop");
14-
Properties.Remove("BackgroundImage");
15-
Properties.Remove("ContextMenu");
16-
Properties.Remove("FlatStyle");
17-
Properties.Remove("Image");
18-
Properties.Remove("ImageAlign");
19-
Properties.Remove("ImageIndex");
20-
Properties.Remove("ImageList");
21-
Properties.Remove("Text");
22-
Properties.Remove("TextAlign");
23-
}
24-
}
6+
{
7+
/// <summary>Clean up some unnecessary properties</summary>
8+
protected override void PostFilterProperties(IDictionary Properties)
9+
{
10+
Properties.Remove("AllowDrop");
11+
Properties.Remove("BackgroundImage");
12+
Properties.Remove("ContextMenu");
13+
Properties.Remove("FlatStyle");
14+
Properties.Remove("Image");
15+
Properties.Remove("ImageAlign");
16+
Properties.Remove("ImageIndex");
17+
Properties.Remove("ImageList");
18+
Properties.Remove("Text");
19+
Properties.Remove("TextAlign");
20+
}
21+
}
2522
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy