private void RemoveDisabledCoinsFromDeviceConfigurations() { foreach (Coin coinConfiguration in CoinConfigurations.Where(c => !c.Enabled)) { IEnumerable <Device> coinDeviceConfigurations = DeviceConfigurations.Where(c => !String.IsNullOrEmpty(c.CoinSymbol) && c.CoinSymbol.Equals(coinConfiguration.PoolGroup.Id)); foreach (Device coinDeviceConfiguration in coinDeviceConfigurations) { coinDeviceConfiguration.CoinSymbol = string.Empty; } } }
private void RemoveDisabledCoinsFromDeviceConfigurations() { foreach (CoinConfiguration coinConfiguration in CoinConfigurations.Where(c => !c.Enabled)) { IEnumerable <DeviceConfiguration> coinDeviceConfigurations = DeviceConfigurations.Where(c => c.CoinSymbol.Equals(coinConfiguration.Coin.Symbol)); foreach (DeviceConfiguration coinDeviceConfiguration in coinDeviceConfigurations) { coinDeviceConfiguration.CoinSymbol = string.Empty; } } }
private void FixDeviceConfigurationSymbolDiscrepencies() { bool save = DeviceConfigurations.Any(dc => dc.CoinSymbol.Equals(KnownCoins.BadDogecoinSymbol, StringComparison.OrdinalIgnoreCase)); foreach (Device deviceConfiguration in DeviceConfigurations.Where(dc => dc.CoinSymbol.Equals(KnownCoins.BadDogecoinSymbol, StringComparison.OrdinalIgnoreCase))) { deviceConfiguration.CoinSymbol = KnownCoins.DogecoinSymbol; } if (save) { SaveDeviceConfigurations(); } }