Skip to content

Commit 3a4ff4b

Browse files
author
Gábor Zavarkó
committed
more cleanup
1 parent f15ecf9 commit 3a4ff4b

File tree

172 files changed

+6522
-6094
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+6522
-6094
lines changed

.editorconfig

+3-3
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ dotnet_naming_symbols.constant_fields.required_modifiers = const
6161
###############################
6262
[*.cs]
6363
# var preferences
64-
csharp_style_var_for_built_in_types = true:silent
65-
csharp_style_var_when_type_is_apparent = true:silent
66-
csharp_style_var_elsewhere = true:silent
64+
csharp_style_var_for_built_in_types = false:warning
65+
csharp_style_var_when_type_is_apparent = true:warning
66+
csharp_style_var_elsewhere = true:warning
6767
# Expression-bodied members
6868
csharp_style_expression_bodied_methods = false:silent
6969
csharp_style_expression_bodied_constructors = false:silent

Demo/Demo.WindowsForms/BSE.Windows.Forms/ProgressBar/ProgressBar.cs

+11-11
Original file line numberDiff line numberDiff line change
@@ -385,13 +385,13 @@ private static void DrawProgressBar(
385385
int iMaximum,
386386
int iValue)
387387
{
388-
Rectangle outerRectangle = GetRectangleBackground(clientRectangle);
388+
var outerRectangle = GetRectangleBackground(clientRectangle);
389389

390-
using (GraphicsPath outerRectangleGraphicsPath = GetBackgroundPath(outerRectangle, 4))
390+
using (var outerRectangleGraphicsPath = GetBackgroundPath(outerRectangle, 4))
391391
{
392392
if (outerRectangleGraphicsPath != null)
393393
{
394-
using (LinearGradientBrush gradientBrush = GetGradientBackBrush(outerRectangle, colorBackgroundEnd))
394+
using (var gradientBrush = GetGradientBackBrush(outerRectangle, colorBackgroundEnd))
395395
{
396396
if (gradientBrush != null)
397397
{
@@ -402,11 +402,11 @@ private static void DrawProgressBar(
402402
// Draws the value rectangle
403403
if (iValue > 0)
404404
{
405-
Rectangle valueRectangle =
405+
var valueRectangle =
406406
GetRectangleValue(outerRectangle, rightToLeft, iMinimum, iMaximum, iValue);
407-
using (GraphicsPath valueGraphicsPath = GetValuePath(valueRectangle, rightToLeft, 5))
407+
using (var valueGraphicsPath = GetValuePath(valueRectangle, rightToLeft, 5))
408408
{
409-
using (LinearGradientBrush gradientBrush =
409+
using (var gradientBrush =
410410
GetGradientBackBrush(valueRectangle, colorValueEnd))
411411
{
412412
if (gradientBrush != null)
@@ -417,7 +417,7 @@ private static void DrawProgressBar(
417417
}
418418
}
419419

420-
using (Pen borderPen = new Pen(borderColor))
420+
using (var borderPen = new Pen(borderColor))
421421
{
422422
graphics.DrawPath(borderPen, outerRectangleGraphicsPath);
423423
}
@@ -427,15 +427,15 @@ private static void DrawProgressBar(
427427

428428
private static Rectangle GetRectangleBackground(Rectangle clientRectangle)
429429
{
430-
Rectangle rectangleBackground = clientRectangle;
430+
var rectangleBackground = clientRectangle;
431431
rectangleBackground.Inflate(-1, -1);
432432
return rectangleBackground;
433433
}
434434

435435
private static Rectangle GetRectangleValue(Rectangle backgroundRectangle, RightToLeft rightToLeft, int iMinimum,
436436
int iMaximum, int iValue)
437437
{
438-
Rectangle valueRectangle = backgroundRectangle;
438+
var valueRectangle = backgroundRectangle;
439439
int iProgressRange = iMaximum - iMinimum;
440440
int iValueRange = iValue - iMinimum;
441441
int iRange = (int)(iValueRange / (float)iProgressRange * backgroundRectangle.Width);
@@ -454,7 +454,7 @@ private static GraphicsPath GetBackgroundPath(Rectangle bounds, int radius)
454454
int y = bounds.Y;
455455
int width = bounds.Width;
456456
int height = bounds.Height;
457-
GraphicsPath graphicsPath = new GraphicsPath();
457+
var graphicsPath = new GraphicsPath();
458458
graphicsPath.AddArc(x, y, radius, radius, 180, 90); //Upper left corner
459459
graphicsPath.AddArc(x + width - radius, y, radius, radius, 270, 90); //Upper right corner
460460
graphicsPath.AddArc(x + width - radius, y + height - radius, radius, radius, 0, 90); //Lower right corner
@@ -469,7 +469,7 @@ private static GraphicsPath GetValuePath(Rectangle bounds, RightToLeft rightToLe
469469
int y = bounds.Y;
470470
int width = bounds.Width;
471471
int height = bounds.Height;
472-
GraphicsPath graphicsPath = new GraphicsPath();
472+
var graphicsPath = new GraphicsPath();
473473
if (rightToLeft == RightToLeft.No)
474474
{
475475
graphicsPath.AddArc(x, y, radius, radius, 180, 90); //Upper left corner

Demo/Demo.WindowsForms/BSE.Windows.Forms/ProgressBar/ToolStripProgressBar.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -225,14 +225,14 @@ protected override void OnOwnerChanged(EventArgs e)
225225
#region MethodsPrivate
226226
private static Control CreateControlInstance()
227227
{
228-
ProgressBar progressBar = new ProgressBar();
228+
var progressBar = new ProgressBar();
229229
progressBar.Size = new Size(100, 15);
230230

231231
return progressBar;
232232
}
233233
private void OwnerRendererChanged(object sender, EventArgs e)
234234
{
235-
ToolStripRenderer toolsTripRenderer = Owner.Renderer;
235+
var toolsTripRenderer = Owner.Renderer;
236236
if (toolsTripRenderer != null)
237237
{
238238
if (toolsTripRenderer is BseRenderer renderer)

0 commit comments

Comments
 (0)