diff --git a/ArchiSteamFarm/ArchiSteamFarm.csproj b/ArchiSteamFarm/ArchiSteamFarm.csproj
index 6a7159e13..98ffedef7 100644
--- a/ArchiSteamFarm/ArchiSteamFarm.csproj
+++ b/ArchiSteamFarm/ArchiSteamFarm.csproj
@@ -90,10 +90,7 @@
-
-
-
diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs
index 58657fe49..ec4ade77b 100755
--- a/ArchiSteamFarm/Bot.cs
+++ b/ArchiSteamFarm/Bot.cs
@@ -60,7 +60,7 @@ namespace ArchiSteamFarm {
private readonly SteamUser SteamUser;
private readonly Trading Trading;
- internal bool KeepRunning { get; private set; } = false;
+ internal bool KeepRunning { get; private set; }
private bool InvalidPassword, LoggedInElsewhere;
private string AuthCode, TwoFactorAuth;
@@ -249,7 +249,6 @@ namespace ArchiSteamFarm {
Logging.LogGenericWarning("If issue persists, consider removing and readding ASF 2FA", BotName);
} catch (Exception e) {
Logging.LogGenericException(e, BotName);
- return;
}
}
diff --git a/ArchiSteamFarm/GlobalConfig.cs b/ArchiSteamFarm/GlobalConfig.cs
index 25abc212c..2d2cc29c9 100644
--- a/ArchiSteamFarm/GlobalConfig.cs
+++ b/ArchiSteamFarm/GlobalConfig.cs
@@ -40,8 +40,7 @@ namespace ArchiSteamFarm {
private const byte DefaultFarmingDelay = 5;
private const byte DefaultHttpTimeout = 60;
private const ushort DefaultWCFPort = 1242;
-
- private static readonly ProtocolType DefaultSteamProtocol = ProtocolType.Tcp;
+ private const ProtocolType DefaultSteamProtocol = ProtocolType.Tcp;
// This is hardcoded blacklist which should not be possible to change
internal static readonly HashSet GlobalBlacklist = new HashSet { 267420, 303700, 335590, 368020, 425280 };
diff --git a/ArchiSteamFarm/GlobalDatabase.cs b/ArchiSteamFarm/GlobalDatabase.cs
index dfdf37d5a..a74fc362c 100644
--- a/ArchiSteamFarm/GlobalDatabase.cs
+++ b/ArchiSteamFarm/GlobalDatabase.cs
@@ -45,7 +45,7 @@ namespace ArchiSteamFarm {
}
[JsonProperty(Required = Required.DisallowNull)]
- private uint _CellID = 0;
+ private uint _CellID;
internal static GlobalDatabase Load() {
if (!File.Exists(FilePath)) {
diff --git a/ArchiSteamFarm/Logging.cs b/ArchiSteamFarm/Logging.cs
index 240c6242e..68d61c3cc 100644
--- a/ArchiSteamFarm/Logging.cs
+++ b/ArchiSteamFarm/Logging.cs
@@ -31,7 +31,7 @@ namespace ArchiSteamFarm {
internal static class Logging {
private static readonly object FileLock = new object();
- private static bool LogToFile = false;
+ private static bool LogToFile;
internal static void Init() {
LogToFile = Program.GlobalConfig.LogToFile;
diff --git a/ArchiSteamFarm/Trading.cs b/ArchiSteamFarm/Trading.cs
index 7faa8a73c..d398f90a6 100644
--- a/ArchiSteamFarm/Trading.cs
+++ b/ArchiSteamFarm/Trading.cs
@@ -37,7 +37,7 @@ namespace ArchiSteamFarm {
private readonly Bot Bot;
private readonly SemaphoreSlim TradesSemaphore = new SemaphoreSlim(1);
- private byte ParsingTasks = 0;
+ private byte ParsingTasks;
internal static async Task LimitInventoryRequestsAsync() {
await InventorySemaphore.WaitAsync().ConfigureAwait(false);
diff --git a/ConfigGenerator/ASFConfig.cs b/ConfigGenerator/ASFConfig.cs
index 4fac33e34..ab974cc9b 100644
--- a/ConfigGenerator/ASFConfig.cs
+++ b/ConfigGenerator/ASFConfig.cs
@@ -29,7 +29,7 @@ using System.IO;
namespace ConfigGenerator {
internal class ASFConfig {
- internal static HashSet ASFConfigs = new HashSet();
+ internal static readonly HashSet ASFConfigs = new HashSet();
internal string FilePath { get; set; }
diff --git a/ConfigGenerator/BotConfig.cs b/ConfigGenerator/BotConfig.cs
index d104cab3c..35a5edba2 100644
--- a/ConfigGenerator/BotConfig.cs
+++ b/ConfigGenerator/BotConfig.cs
@@ -119,7 +119,7 @@ namespace ConfigGenerator {
}
// This constructor is used only by deserializer
- private BotConfig() : base() { }
+ private BotConfig() { }
private BotConfig(string filePath) : base(filePath) {
FilePath = filePath;
diff --git a/ConfigGenerator/ConfigGenerator.csproj b/ConfigGenerator/ConfigGenerator.csproj
index d3b742478..8bf4c05ac 100644
--- a/ConfigGenerator/ConfigGenerator.csproj
+++ b/ConfigGenerator/ConfigGenerator.csproj
@@ -44,14 +44,8 @@
-
-
-
-
-
-
diff --git a/ConfigGenerator/ConfigPage.cs b/ConfigGenerator/ConfigPage.cs
index 73c76774e..7eaf7a843 100644
--- a/ConfigGenerator/ConfigPage.cs
+++ b/ConfigGenerator/ConfigPage.cs
@@ -27,12 +27,9 @@ using System.Windows.Forms;
namespace ConfigGenerator {
internal class ConfigPage : TabPage {
-
internal readonly ASFConfig ASFConfig;
- private EnhancedPropertyGrid EnhancedPropertyGrid;
-
- internal ConfigPage(ASFConfig config) : base() {
+ internal ConfigPage(ASFConfig config) {
if (config == null) {
return;
}
@@ -41,17 +38,12 @@ namespace ConfigGenerator {
RefreshText();
- EnhancedPropertyGrid = new EnhancedPropertyGrid(config);
- Controls.Add(EnhancedPropertyGrid);
+ EnhancedPropertyGrid enhancedPropertyGrid = new EnhancedPropertyGrid(config);
+ Controls.Add(enhancedPropertyGrid);
}
internal void RefreshText() {
Text = Path.GetFileNameWithoutExtension(ASFConfig.FilePath);
}
-
- private void InitializeComponent() {
- SuspendLayout();
- ResumeLayout(false);
- }
}
}
diff --git a/ConfigGenerator/EnhancedPropertyGrid.cs b/ConfigGenerator/EnhancedPropertyGrid.cs
index a4cb0168c..91a799198 100644
--- a/ConfigGenerator/EnhancedPropertyGrid.cs
+++ b/ConfigGenerator/EnhancedPropertyGrid.cs
@@ -26,9 +26,9 @@ using System.Windows.Forms;
namespace ConfigGenerator {
internal sealed class EnhancedPropertyGrid : PropertyGrid {
- private ASFConfig ASFConfig;
+ private readonly ASFConfig ASFConfig;
- internal EnhancedPropertyGrid(ASFConfig config) : base() {
+ internal EnhancedPropertyGrid(ASFConfig config) {
if (config == null) {
return;
}
@@ -66,7 +66,6 @@ namespace ConfigGenerator {
if (globalConfig.SteamOwnerID != 0) {
Tutorial.OnAction(Tutorial.EPhase.GlobalConfigReady);
}
- return;
}
}
}
diff --git a/ConfigGenerator/GlobalConfig.cs b/ConfigGenerator/GlobalConfig.cs
index 72bb4a28e..39d717ca7 100644
--- a/ConfigGenerator/GlobalConfig.cs
+++ b/ConfigGenerator/GlobalConfig.cs
@@ -40,8 +40,7 @@ namespace ConfigGenerator {
private const byte DefaultFarmingDelay = 5;
private const byte DefaultHttpTimeout = 60;
private const ushort DefaultWCFPort = 1242;
-
- private static readonly ProtocolType DefaultSteamProtocol = ProtocolType.Tcp;
+ private const ProtocolType DefaultSteamProtocol = ProtocolType.Tcp;
// This is hardcoded blacklist which should not be possible to change
internal static readonly HashSet GlobalBlacklist = new HashSet { 267420, 303700, 335590, 368020, 425280 };
@@ -161,7 +160,7 @@ namespace ConfigGenerator {
}
// This constructor is used only by deserializer
- private GlobalConfig() : base() { }
+ private GlobalConfig() { }
private GlobalConfig(string filePath) : base(filePath) {
FilePath = filePath;
diff --git a/ConfigGenerator/MainForm.cs b/ConfigGenerator/MainForm.cs
index 09534117c..25b3e664b 100644
--- a/ConfigGenerator/MainForm.cs
+++ b/ConfigGenerator/MainForm.cs
@@ -23,6 +23,7 @@
*/
using System;
+using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Windows.Forms;
@@ -31,20 +32,11 @@ namespace ConfigGenerator {
public partial class MainForm : Form {
private const byte ReservedTabs = 3;
+ private readonly TabPage NewTab = new TabPage { Text = "+" };
+ private readonly TabPage RemoveTab = new TabPage { Text = "-" };
+ private readonly TabPage RenameTab = new TabPage { Text = "~" };
+
private ConfigPage ASFTab;
-
- private TabPage RemoveTab = new TabPage() {
- Text = "-",
- };
-
- private TabPage RenameTab = new TabPage() {
- Text = "~",
- };
-
- private TabPage NewTab = new TabPage() {
- Text = "+",
- };
-
private TabPage OldTab;
public MainForm() {
@@ -73,7 +65,7 @@ namespace ConfigGenerator {
Tutorial.Enabled = false;
}
- MainTab.TabPages.AddRange(new TabPage[] { RemoveTab, RenameTab, NewTab });
+ MainTab.TabPages.AddRange(new[] { RemoveTab, RenameTab, NewTab });
Tutorial.OnAction(Tutorial.EPhase.Start);
}
@@ -186,7 +178,7 @@ namespace ConfigGenerator {
Tutorial.OnAction(Tutorial.EPhase.Shown);
}
- private void MainForm_HelpButtonClicked(object sender, System.ComponentModel.CancelEventArgs e) {
+ private void MainForm_HelpButtonClicked(object sender, CancelEventArgs e) {
if (sender == null || e == null) {
return;
}
diff --git a/ConfigGenerator/Program.cs b/ConfigGenerator/Program.cs
index 8bc5bdc4f..9944bafdc 100644
--- a/ConfigGenerator/Program.cs
+++ b/ConfigGenerator/Program.cs
@@ -36,10 +36,7 @@ namespace ConfigGenerator {
private const string ASFDirectory = "ArchiSteamFarm";
- private static readonly Assembly Assembly = Assembly.GetExecutingAssembly();
- private static readonly string ExecutableFile = Assembly.Location;
- private static readonly string ExecutableName = Path.GetFileName(ExecutableFile);
- private static readonly string ExecutableDirectory = Path.GetDirectoryName(ExecutableFile);
+ private static readonly string ExecutableDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
///
/// The main entry point for the application.