private void txtRefreshRateMarketCap_KeyUp(object sender, KeyEventArgs e) { string strError = string.Empty; int refreshrate = 0; int.TryParse(txtRefreshRateMarketCap.Text, out refreshrate); if (refreshrate != 0) { MarketCapitalizationCall call = new MarketCapitalizationCall(); call.UpdateMarketCapitalization(new MarketCapitalizationSettings() { RefreshRate = refreshrate * 60, Source = SettingsManager.AppSettings.MarketCap.Source }, ref strError); if (!string.IsNullOrEmpty(strError)) { MessageBox.Show("An error occurred while trying to save the market cap refresh rate" + Environment.NewLine + Environment.NewLine + strError, "", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { SettingsManager.AppSettings.MarketCap.RefreshRate = refreshrate * 60; } } }
private void RadioButtons_CheckedChanged(object sender, EventArgs e) { string strError = string.Empty; MarketCapitalizationCall call = new MarketCapitalizationCall(); if (sender == btnCoinMarketCap) { if (btnCoinMarketCap.Checked) SettingsManager.AppSettings.MarketCap.Source = SettingsManager.AppSettings.MarketCap.CoinMarketCap; } else if (sender == btnCryptMarketCap) { if (btnCryptMarketCap.Checked) SettingsManager.AppSettings.MarketCap.Source = SettingsManager.AppSettings.MarketCap.CryptMarketCap; } call.UpdateMarketCapitalization(new MarketCapitalizationSettings() { Source = SettingsManager.AppSettings.MarketCap.Source, RefreshRate = SettingsManager.AppSettings.MarketCap.RefreshRate }, ref strError); if (!string.IsNullOrEmpty(strError)) { MessageBox.Show("An error occurred while trying to update the marketcap source", "", MessageBoxButtons.OK, MessageBoxIcon.Error); } }