private void saveButton_Click(object sender, EventArgs e) { string coinName = coinCombo.Text; CryptoCoin knownCoin = sortedCoins.SingleOrDefault(c => c.Name.Equals(coinName, StringComparison.OrdinalIgnoreCase)); if (knownCoin == null) { CryptoCoin newCoin = new CryptoCoin(); newCoin.Name = coinName; newCoin.Algorithm = Xgminer.CoinAlgorithm.SHA256; CoinEditForm coinEditForm = new CoinEditForm(newCoin); if (coinEditForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { SelectedCoin = newCoin; } else { DialogResult = System.Windows.Forms.DialogResult.Cancel; } } else { SelectedCoin = knownCoin; } }
private void saveButton_Click(object sender, EventArgs e) { CryptoCoin knownCoin = null; if (coinCombo.SelectedIndex >= 0) { knownCoin = sortedCoins[coinCombo.SelectedIndex]; } if (knownCoin == null) { CryptoCoin newCoin = new CryptoCoin(); newCoin.Name = coinCombo.Text; newCoin.Algorithm = Xgminer.CoinAlgorithm.SHA256; CoinEditForm coinEditForm = new CoinEditForm(newCoin); if (coinEditForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { SelectedCoin = newCoin; } else { DialogResult = System.Windows.Forms.DialogResult.Cancel; } } else { SelectedCoin = knownCoin; } }
private void saveButton_Click(object sender, EventArgs e) { string coinName = coinCombo.Text; CryptoCoin knownCoin = sortedCoins.SingleOrDefault(c => c.Name.Equals(coinName, StringComparison.OrdinalIgnoreCase)); if (knownCoin == null) { CryptoCoin newCoin = new CryptoCoin(); newCoin.Name = coinName; newCoin.Algorithm = Xgminer.CoinAlgorithm.SHA256; CoinEditForm coinEditForm = new CoinEditForm(newCoin); if (coinEditForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) SelectedCoin = newCoin; else DialogResult = System.Windows.Forms.DialogResult.Cancel; } else { SelectedCoin = knownCoin; } }
private void saveButton_Click(object sender, EventArgs e) { CryptoCoin knownCoin = null; if (coinCombo.SelectedIndex >= 0) knownCoin = sortedCoins[coinCombo.SelectedIndex]; if (knownCoin == null) { CryptoCoin newCoin = new CryptoCoin(); newCoin.Name = coinCombo.Text; newCoin.Algorithm = Xgminer.CoinAlgorithm.SHA256; CoinEditForm coinEditForm = new CoinEditForm(newCoin); if (coinEditForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) SelectedCoin = newCoin; else DialogResult = System.Windows.Forms.DialogResult.Cancel; } else { SelectedCoin = knownCoin; } }