Use newer syntax for Enum.IsDefined()

This commit is contained in:
Archi
2022-01-23 01:37:43 +01:00
parent 4258fed873
commit dae6f9d328
22 changed files with 143 additions and 142 deletions

View File

@@ -441,7 +441,7 @@ public sealed class GlobalConfig {
return (false, string.Format(CultureInfo.CurrentCulture, Strings.ErrorConfigPropertyInvalid, nameof(FarmingDelay), FarmingDelay));
}
if (!Enum.IsDefined(typeof(ArchiCryptoHelper.EHashingMethod), IPCPasswordFormat)) {
if (!Enum.IsDefined(IPCPasswordFormat)) {
return (false, string.Format(CultureInfo.CurrentCulture, Strings.ErrorConfigPropertyInvalid, nameof(IPCPasswordFormat), IPCPasswordFormat));
}
@@ -449,7 +449,7 @@ public sealed class GlobalConfig {
return (false, string.Format(CultureInfo.CurrentCulture, Strings.ErrorConfigPropertyInvalid, nameof(MaxFarmingTime), MaxFarmingTime));
}
if (!Enum.IsDefined(typeof(EOptimizationMode), OptimizationMode)) {
if (!Enum.IsDefined(OptimizationMode)) {
return (false, string.Format(CultureInfo.CurrentCulture, Strings.ErrorConfigPropertyInvalid, nameof(OptimizationMode), OptimizationMode));
}
@@ -465,7 +465,7 @@ public sealed class GlobalConfig {
return (false, string.Format(CultureInfo.CurrentCulture, Strings.ErrorConfigPropertyInvalid, nameof(SteamProtocols), SteamProtocols));
}
return Enum.IsDefined(typeof(EUpdateChannel), UpdateChannel) ? (true, null) : (false, string.Format(CultureInfo.CurrentCulture, Strings.ErrorConfigPropertyInvalid, nameof(UpdateChannel), UpdateChannel));
return Enum.IsDefined(UpdateChannel) ? (true, null) : (false, string.Format(CultureInfo.CurrentCulture, Strings.ErrorConfigPropertyInvalid, nameof(UpdateChannel), UpdateChannel));
}
internal static async Task<(GlobalConfig? GlobalConfig, string? LatestJson)> Load(string filePath) {