@@ -385,13 +385,13 @@ private static void DrawProgressBar(
385
385
int iMaximum ,
386
386
int iValue )
387
387
{
388
- Rectangle outerRectangle = GetRectangleBackground ( clientRectangle ) ;
388
+ var outerRectangle = GetRectangleBackground ( clientRectangle ) ;
389
389
390
- using ( GraphicsPath outerRectangleGraphicsPath = GetBackgroundPath ( outerRectangle , 4 ) )
390
+ using ( var outerRectangleGraphicsPath = GetBackgroundPath ( outerRectangle , 4 ) )
391
391
{
392
392
if ( outerRectangleGraphicsPath != null )
393
393
{
394
- using ( LinearGradientBrush gradientBrush = GetGradientBackBrush ( outerRectangle , colorBackgroundEnd ) )
394
+ using ( var gradientBrush = GetGradientBackBrush ( outerRectangle , colorBackgroundEnd ) )
395
395
{
396
396
if ( gradientBrush != null )
397
397
{
@@ -402,11 +402,11 @@ private static void DrawProgressBar(
402
402
// Draws the value rectangle
403
403
if ( iValue > 0 )
404
404
{
405
- Rectangle valueRectangle =
405
+ var valueRectangle =
406
406
GetRectangleValue ( outerRectangle , rightToLeft , iMinimum , iMaximum , iValue ) ;
407
- using ( GraphicsPath valueGraphicsPath = GetValuePath ( valueRectangle , rightToLeft , 5 ) )
407
+ using ( var valueGraphicsPath = GetValuePath ( valueRectangle , rightToLeft , 5 ) )
408
408
{
409
- using ( LinearGradientBrush gradientBrush =
409
+ using ( var gradientBrush =
410
410
GetGradientBackBrush ( valueRectangle , colorValueEnd ) )
411
411
{
412
412
if ( gradientBrush != null )
@@ -417,7 +417,7 @@ private static void DrawProgressBar(
417
417
}
418
418
}
419
419
420
- using ( Pen borderPen = new Pen ( borderColor ) )
420
+ using ( var borderPen = new Pen ( borderColor ) )
421
421
{
422
422
graphics . DrawPath ( borderPen , outerRectangleGraphicsPath ) ;
423
423
}
@@ -427,15 +427,15 @@ private static void DrawProgressBar(
427
427
428
428
private static Rectangle GetRectangleBackground ( Rectangle clientRectangle )
429
429
{
430
- Rectangle rectangleBackground = clientRectangle ;
430
+ var rectangleBackground = clientRectangle ;
431
431
rectangleBackground . Inflate ( - 1 , - 1 ) ;
432
432
return rectangleBackground ;
433
433
}
434
434
435
435
private static Rectangle GetRectangleValue ( Rectangle backgroundRectangle , RightToLeft rightToLeft , int iMinimum ,
436
436
int iMaximum , int iValue )
437
437
{
438
- Rectangle valueRectangle = backgroundRectangle ;
438
+ var valueRectangle = backgroundRectangle ;
439
439
int iProgressRange = iMaximum - iMinimum ;
440
440
int iValueRange = iValue - iMinimum ;
441
441
int iRange = ( int ) ( iValueRange / ( float ) iProgressRange * backgroundRectangle . Width ) ;
@@ -454,7 +454,7 @@ private static GraphicsPath GetBackgroundPath(Rectangle bounds, int radius)
454
454
int y = bounds . Y ;
455
455
int width = bounds . Width ;
456
456
int height = bounds . Height ;
457
- GraphicsPath graphicsPath = new GraphicsPath ( ) ;
457
+ var graphicsPath = new GraphicsPath ( ) ;
458
458
graphicsPath . AddArc ( x , y , radius , radius , 180 , 90 ) ; //Upper left corner
459
459
graphicsPath . AddArc ( x + width - radius , y , radius , radius , 270 , 90 ) ; //Upper right corner
460
460
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
469
469
int y = bounds . Y ;
470
470
int width = bounds . Width ;
471
471
int height = bounds . Height ;
472
- GraphicsPath graphicsPath = new GraphicsPath ( ) ;
472
+ var graphicsPath = new GraphicsPath ( ) ;
473
473
if ( rightToLeft == RightToLeft . No )
474
474
{
475
475
graphicsPath . AddArc ( x , y , radius , radius , 180 , 90 ) ; //Upper left corner
0 commit comments