Misc readability improvement

This commit is contained in:
JustArchi
2017-01-05 21:08:13 +01:00
parent ab020ed5a2
commit bdc354d07c
4 changed files with 24 additions and 7 deletions

View File

@@ -66,7 +66,10 @@ namespace ArchiSteamFarm {
}
if ((AutoUpdatesTimer == null) && Program.GlobalConfig.AutoUpdates) {
AutoUpdatesTimer = new Timer(async e => await CheckForUpdate().ConfigureAwait(false), null, TimeSpan.FromDays(1), // Delay
AutoUpdatesTimer = new Timer(
async e => await CheckForUpdate().ConfigureAwait(false),
null,
TimeSpan.FromDays(1), // Delay
TimeSpan.FromDays(1) // Period
);

View File

@@ -73,7 +73,11 @@ namespace ArchiSteamFarm {
internal readonly bool IsBotAccount = false;
[JsonProperty(ObjectCreationHandling = ObjectCreationHandling.Replace, Required = Required.DisallowNull)]
internal readonly HashSet<Steam.Item.EType> LootableTypes = new HashSet<Steam.Item.EType> { Steam.Item.EType.BoosterPack, Steam.Item.EType.FoilTradingCard, Steam.Item.EType.TradingCard };
internal readonly HashSet<Steam.Item.EType> LootableTypes = new HashSet<Steam.Item.EType> {
Steam.Item.EType.BoosterPack,
Steam.Item.EType.FoilTradingCard,
Steam.Item.EType.TradingCard
};
[JsonProperty(Required = Required.DisallowNull)]
internal readonly CryptoHelper.ECryptoMethod PasswordFormat = CryptoHelper.ECryptoMethod.PlainText;

View File

@@ -103,8 +103,11 @@ namespace ArchiSteamFarm {
}
try {
byte[] decryptedData = ProtectedData.Unprotect(Convert.FromBase64String(encrypted), EncryptionKey, // This is used as salt only and it's fine that it's known
DataProtectionScope.CurrentUser);
byte[] decryptedData = ProtectedData.Unprotect(
Convert.FromBase64String(encrypted),
EncryptionKey, // This is used as salt only and it's fine that it's known
DataProtectionScope.CurrentUser
);
return Encoding.UTF8.GetString(decryptedData);
} catch (Exception e) {
@@ -141,8 +144,11 @@ namespace ArchiSteamFarm {
}
try {
byte[] encryptedData = ProtectedData.Protect(Encoding.UTF8.GetBytes(decrypted), EncryptionKey, // This is used as salt only and it's fine that it's known
DataProtectionScope.CurrentUser);
byte[] encryptedData = ProtectedData.Protect(
Encoding.UTF8.GetBytes(decrypted),
EncryptionKey, // This is used as salt only and it's fine that it's known
DataProtectionScope.CurrentUser
);
return Convert.ToBase64String(encryptedData);
} catch (Exception e) {

View File

@@ -80,7 +80,11 @@ namespace ConfigGenerator {
[Category("\tAdvanced")]
[JsonProperty(ObjectCreationHandling = ObjectCreationHandling.Replace, Required = Required.DisallowNull)]
public List<Steam.Item.EType> LootableTypes { get; set; } = new List<Steam.Item.EType> { Steam.Item.EType.BoosterPack, Steam.Item.EType.FoilTradingCard, Steam.Item.EType.TradingCard };
public List<Steam.Item.EType> LootableTypes { get; set; } = new List<Steam.Item.EType> {
Steam.Item.EType.BoosterPack,
Steam.Item.EType.FoilTradingCard,
Steam.Item.EType.TradingCard
};
[Category("\tAccess")]
[JsonProperty(Required = Required.DisallowNull)]