Apply Rider recommendations
This commit is contained in:
Submodule VAR.HttpServer updated: e80b0e3619...f7c1a581e7
@@ -1,8 +1,6 @@
|
|||||||
using VAR.Toolbox.Code.Bots;
|
namespace VAR.Toolbox.Code.Bots
|
||||||
|
|
||||||
namespace VAR.Toolbox.Code
|
|
||||||
{
|
{
|
||||||
public class AutomationBotFactory: BaseFactory<IAutomationBot>
|
public abstract class AutomationBotFactory: BaseFactory<IAutomationBot>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12,12 +12,12 @@ namespace VAR.Toolbox.Code.Bots
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Init(VAR.Toolbox.Code.IOutputHandler output, IConfiguration config)
|
public void Init(IOutputHandler output, IConfiguration config)
|
||||||
{
|
{
|
||||||
output.Clean();
|
output.Clean();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Bitmap Process(Bitmap bmpInput, VAR.Toolbox.Code.IOutputHandler output)
|
public Bitmap Process(Bitmap bmpInput, IOutputHandler output)
|
||||||
{
|
{
|
||||||
return bmpInput;
|
return bmpInput;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ namespace VAR.Toolbox.Code.Bots
|
|||||||
public interface IAutomationBot: INamed
|
public interface IAutomationBot: INamed
|
||||||
{
|
{
|
||||||
IConfiguration GetDefaultConfiguration();
|
IConfiguration GetDefaultConfiguration();
|
||||||
void Init(VAR.Toolbox.Code.IOutputHandler output, IConfiguration config);
|
void Init(IOutputHandler output, IConfiguration config);
|
||||||
Bitmap Process(Bitmap bmpInput, VAR.Toolbox.Code.IOutputHandler output);
|
Bitmap Process(Bitmap bmpInput, IOutputHandler output);
|
||||||
string ResponseKeys();
|
string ResponseKeys();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -38,7 +38,7 @@ namespace VAR.Toolbox.Code.Bots
|
|||||||
return defaultConfiguration;
|
return defaultConfiguration;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Init(VAR.Toolbox.Code.IOutputHandler output, IConfiguration config)
|
public void Init(IOutputHandler output, IConfiguration config)
|
||||||
{
|
{
|
||||||
int gridWidth = config.Get("GridWidth", DefaultGridWidth);
|
int gridWidth = config.Get("GridWidth", DefaultGridWidth);
|
||||||
int gridHeight = config.Get("GridHeight", DefaultGridHeight);
|
int gridHeight = config.Get("GridHeight", DefaultGridHeight);
|
||||||
@@ -59,7 +59,7 @@ namespace VAR.Toolbox.Code.Bots
|
|||||||
output.AddLine($"TetrisBot: Starting {DateTime.UtcNow:s}");
|
output.AddLine($"TetrisBot: Starting {DateTime.UtcNow:s}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public Bitmap Process(Bitmap bmpInput, VAR.Toolbox.Code.IOutputHandler output)
|
public Bitmap Process(Bitmap bmpInput, IOutputHandler output)
|
||||||
{
|
{
|
||||||
_grid.SampleFromBitmap(bmpInput);
|
_grid.SampleFromBitmap(bmpInput);
|
||||||
SearchShape();
|
SearchShape();
|
||||||
@@ -549,7 +549,7 @@ namespace VAR.Toolbox.Code.Bots
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Print(VAR.Toolbox.Code.IOutputHandler output)
|
public void Print(IOutputHandler output)
|
||||||
{
|
{
|
||||||
for (int y = 0; y < ShapeSize; y++)
|
for (int y = 0; y < ShapeSize; y++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ using System.Text;
|
|||||||
|
|
||||||
namespace VAR.Toolbox.Code
|
namespace VAR.Toolbox.Code
|
||||||
{
|
{
|
||||||
public class HexUtils
|
public static class HexUtils
|
||||||
{
|
{
|
||||||
public static byte[] HexStringToBytes(string input)
|
public static byte[] HexStringToBytes(string input)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ using System.IO;
|
|||||||
|
|
||||||
namespace VAR.Toolbox.Code
|
namespace VAR.Toolbox.Code
|
||||||
{
|
{
|
||||||
public class Logger
|
public static class Logger
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Obtiene el StreamWriter de salida
|
/// Obtiene el StreamWriter de salida
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using VAR.Toolbox.Code.Windows;
|
|||||||
|
|
||||||
namespace VAR.Toolbox.Code
|
namespace VAR.Toolbox.Code
|
||||||
{
|
{
|
||||||
public class Mouse
|
public static class Mouse
|
||||||
{
|
{
|
||||||
public static void Move(int dx, int dy)
|
public static void Move(int dx, int dy)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace VAR.Toolbox.Code.ProxyCmdExecutors
|
namespace VAR.Toolbox.Code.ProxyCmdExecutors
|
||||||
{
|
{
|
||||||
public class ProxyCmdExecutorFactory : BaseFactory<IProxyCmdExecutor> { }
|
public abstract class ProxyCmdExecutorFactory : BaseFactory<IProxyCmdExecutor> { }
|
||||||
}
|
}
|
||||||
@@ -15,8 +15,8 @@ namespace VAR.Toolbox.Code.ProxyCmdExecutors
|
|||||||
|
|
||||||
public bool ExecuteCmd(string cmd, IOutputHandler outputHandler)
|
public bool ExecuteCmd(string cmd, IOutputHandler outputHandler)
|
||||||
{
|
{
|
||||||
string parameters = string.Format(" /node:\"{0}\" process call create \"cmd.exe /c \\\"{1}\\\"\"",
|
string parameters =
|
||||||
_configWMIC.Replace("\"", "\\\""), cmd.Replace("\"", "\\\""));
|
$" /node:\"{_configWMIC.Replace("\"", "\\\"")}\" process call create \"cmd.exe /c \\\"{cmd.Replace("\"", "\\\"")}\\\"\"";
|
||||||
Process process = new Process();
|
Process process = new Process();
|
||||||
process.StartInfo.UseShellExecute = false;
|
process.StartInfo.UseShellExecute = false;
|
||||||
process.StartInfo.RedirectStandardOutput = true;
|
process.StartInfo.RedirectStandardOutput = true;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace VAR.Toolbox.Code.TextCoders
|
namespace VAR.Toolbox.Code.TextCoders
|
||||||
{
|
{
|
||||||
public class TextCoderFactory : BaseFactory<ITextCoder> { }
|
public abstract class TextCoderFactory : BaseFactory<ITextCoder> { }
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace VAR.Toolbox.Code.WorkLog
|
namespace VAR.Toolbox.Code.WorkLog
|
||||||
{
|
{
|
||||||
public class WorkLogImporterFactory : BaseFactory<IWorkLogImporter> { }
|
public abstract class WorkLogImporterFactory : BaseFactory<IWorkLogImporter> { }
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,7 @@ using System.Runtime.InteropServices;
|
|||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("")]
|
[assembly: AssemblyCompany("")]
|
||||||
[assembly: AssemblyProduct("VAR.Toolbox")]
|
[assembly: AssemblyProduct("VAR.Toolbox")]
|
||||||
[assembly: AssemblyCopyright("Copyright © VAR 2017-2018")]
|
[assembly: AssemblyCopyright("Copyright © VAR 2017-2022")]
|
||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
[assembly: ComVisible(false)]
|
[assembly: ComVisible(false)]
|
||||||
|
|||||||
@@ -92,8 +92,7 @@ namespace VAR.Toolbox.UI.Tools
|
|||||||
private void SetCountdown(DateTime dateTime, DateTime now)
|
private void SetCountdown(DateTime dateTime, DateTime now)
|
||||||
{
|
{
|
||||||
TimeSpan timeSpan = dateTime - now;
|
TimeSpan timeSpan = dateTime - now;
|
||||||
lblCountdown.Text = string.Format("{0:00}:{1:00}:{2:00}:{3:00}", timeSpan.Days, timeSpan.Hours,
|
lblCountdown.Text = $"{timeSpan.Days:00}:{timeSpan.Hours:00}:{timeSpan.Minutes:00}:{timeSpan.Seconds:00}";
|
||||||
timeSpan.Minutes, timeSpan.Seconds);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckTime(CheckBox chk, DateTime dtSuspendAtCustom, DateTime now)
|
private void CheckTime(CheckBox chk, DateTime dtSuspendAtCustom, DateTime now)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace VAR.ScreenAutomation
|
namespace VAR.Toolbox.UI.Tools.ScreenAutomation
|
||||||
{
|
{
|
||||||
partial class FrmAutomationBotParams
|
partial class FrmAutomationBotParams
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ using System.Windows.Forms;
|
|||||||
using VAR.Toolbox.Code.Configuration;
|
using VAR.Toolbox.Code.Configuration;
|
||||||
using VAR.Toolbox.Controls;
|
using VAR.Toolbox.Controls;
|
||||||
|
|
||||||
namespace VAR.ScreenAutomation
|
namespace VAR.Toolbox.UI.Tools.ScreenAutomation
|
||||||
{
|
{
|
||||||
public partial class FrmAutomationBotParams : Frame
|
public partial class FrmAutomationBotParams : Frame
|
||||||
{
|
{
|
||||||
@@ -69,7 +69,7 @@ namespace VAR.ScreenAutomation
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (columnName == "Key" && Parent != null && Parent.Any(
|
if (columnName == "Key" && Parent != null && Parent.Any(
|
||||||
x => x.Key == this.Key && !ReferenceEquals(x, this)))
|
x => x.Key == Key && !ReferenceEquals(x, this)))
|
||||||
{
|
{
|
||||||
return "duplicate key";
|
return "duplicate key";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
namespace VAR.ScreenAutomation
|
namespace VAR.Toolbox.UI.Tools.ScreenAutomation
|
||||||
{
|
{
|
||||||
partial class FrmScreenAutomation
|
partial class FrmScreenAutomation
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ using VAR.Toolbox.Controls;
|
|||||||
|
|
||||||
// ReSharper disable LocalizableElement
|
// ReSharper disable LocalizableElement
|
||||||
|
|
||||||
namespace VAR.ScreenAutomation
|
namespace VAR.Toolbox.UI.Tools.ScreenAutomation
|
||||||
{
|
{
|
||||||
public partial class FrmScreenAutomation : Frame, Toolbox.UI.IToolForm
|
public partial class FrmScreenAutomation : Frame, IToolForm
|
||||||
{
|
{
|
||||||
public string ToolName => "ScreenAutomation";
|
public string ToolName => "ScreenAutomation";
|
||||||
|
|
||||||
|
|||||||
@@ -104,16 +104,12 @@ namespace VAR.Toolbox.UI.Tools.WorkLog
|
|||||||
currentCulture.DateTimeFormat.CalendarWeekRule, currentCulture.DateTimeFormat.FirstDayOfWeek);
|
currentCulture.DateTimeFormat.CalendarWeekRule, currentCulture.DateTimeFormat.FirstDayOfWeek);
|
||||||
if (week != null && week != weekCurrent)
|
if (week != null && week != weekCurrent)
|
||||||
{
|
{
|
||||||
strDays.Add(string.Format(" [{0:00}] -- {1} h",
|
strDays.Add($" [{week:00}] -- {tsWeek.TotalHours} h");
|
||||||
week,
|
|
||||||
tsWeek.TotalHours));
|
|
||||||
tsWeek = new TimeSpan(0);
|
tsWeek = new TimeSpan(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
TimeSpan tsDay = dictDaysHours[dateDayCurrent];
|
TimeSpan tsDay = dictDaysHours[dateDayCurrent];
|
||||||
strDays.Add(string.Format("[{0:00}] {1:yyyy-MM-dd} -- {2} h",
|
strDays.Add($"[{weekCurrent:00}] {dateDayCurrent:yyyy-MM-dd} -- {tsDay.TotalHours} h");
|
||||||
weekCurrent, dateDayCurrent,
|
|
||||||
tsDay.TotalHours));
|
|
||||||
tsTotal += tsDay;
|
tsTotal += tsDay;
|
||||||
tsWeek += tsDay;
|
tsWeek += tsDay;
|
||||||
week = weekCurrent;
|
week = weekCurrent;
|
||||||
@@ -124,9 +120,7 @@ namespace VAR.Toolbox.UI.Tools.WorkLog
|
|||||||
|
|
||||||
if (tsWeek.TotalHours > 0)
|
if (tsWeek.TotalHours > 0)
|
||||||
{
|
{
|
||||||
strDays.Add(string.Format(" [{0:00}] -- {1} h",
|
strDays.Add($" [{week:00}] -- {tsWeek.TotalHours} h");
|
||||||
week,
|
|
||||||
tsWeek.TotalHours));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lsbDays.Items.Clear();
|
lsbDays.Items.Clear();
|
||||||
|
|||||||
Reference in New Issue
Block a user