Changes recommended by Rider/Resharper

This commit is contained in:
2022-04-09 00:55:02 +02:00
parent 73e7fe89f1
commit fc5b81014b
28 changed files with 982 additions and 790 deletions

View File

@@ -8,7 +8,7 @@ namespace VAR.ScreenAutomation.Controls
{
#region Declarations
private Image _imageShow = null;
private Image _imageShow;
#endregion
@@ -16,7 +16,8 @@ namespace VAR.ScreenAutomation.Controls
public Image ImageShow
{
get { return _imageShow; }
// ReSharper disable once InconsistentlySynchronizedField
get => _imageShow;
set
{
lock (this)
@@ -32,6 +33,11 @@ namespace VAR.ScreenAutomation.Controls
#region Control life cycle
public CtrImageViewer()
{
InitializeComponent();
}
private void InitializeComponent()
{
BackColor = Color.Black;
}
@@ -59,6 +65,7 @@ namespace VAR.ScreenAutomation.Controls
{
return;
}
lock (_imageShow)
{
if (graph == null)
@@ -71,7 +78,7 @@ namespace VAR.ScreenAutomation.Controls
int imgDrawHeight;
float imgDrawX = 0;
float imgDrawY = 0;
float relation = (float)_imageShow.Width / (float)_imageShow.Height;
float relation = _imageShow.Width / (float)_imageShow.Height;
if (relation > 0)
{
// Imagen mas ancha que alta
@@ -110,6 +117,5 @@ namespace VAR.ScreenAutomation.Controls
}
#endregion
}
}
}