Beispiel #1
0
        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.Data.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;
            }
        }
Beispiel #2
0
        private void saveButton_Click(object sender, EventArgs e)
        {
            CryptoCoin knownCoin = null;

            if (coinCombo.SelectedIndex >= 0)
            {
                knownCoin = filteredCoins[coinCombo.SelectedIndex];
            }

            if (knownCoin == null)
            {
                CryptoCoin newCoin = new CryptoCoin();
                newCoin.Name      = coinCombo.Text;
                newCoin.Algorithm = algoCombo.Text.ToAlgorithm();

                using (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;
            }
        }
Beispiel #3
0
        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.Data.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 = filteredCoins[coinCombo.SelectedIndex];

            if (knownCoin == null)
            {
                CryptoCoin newCoin = new CryptoCoin();
                newCoin.Name = coinCombo.Text;
                newCoin.Algorithm = GetSelectedAlgorithm().Name;

                using (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;
            }
        }