private bool DoCurrencyDialog(Currency c)
        {
            CurrencyProperties dlg = new CurrencyProperties();

            dlg.NameBox.Text            = c.mName;
            dlg.Symbol.Text             = c.mSymbol;
            dlg.IPAddress.Text          = c.mIPAddress;
            dlg.Port.Text               = c.mPort.ToString();
            dlg.NetVersion.Text         = c.mNetVersion.ToString();
            dlg.NetID.Text              = c.mNetID.ToString();
            dlg.BlockTarget.Text        = c.mBlockTarget.ToString();
            dlg.CoinsPerBlock.Text      = c.mCoinsPerBlock.ToString();
            dlg.POS.Checked             = c.mPOS;
            dlg.IgnoreSigLen.Checked    = c.mIgnoreSigLen;
            dlg.ScryptBlockHash.Checked = c.mScryptBlockHash;
            dlg.CryptsyID.Text          = c.mCryptsyMarket;
            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                c.mName          = dlg.NameBox.Text;
                c.mSymbol        = dlg.Symbol.Text;
                c.mIPAddress     = dlg.IPAddress.Text;
                c.mCryptsyMarket = dlg.CryptsyID.Text;
                try { c.mPort = Convert.ToUInt16(dlg.Port.Text); }
                catch (Exception) { }
                try { c.mNetVersion = Convert.ToUInt32(dlg.NetVersion.Text); }
                catch (Exception) { }
                try { c.mNetID = Convert.ToUInt32(dlg.NetID.Text); }
                catch (Exception) { }
                try { c.mBlockTarget = Convert.ToUInt32(dlg.BlockTarget.Text); }
                catch (Exception) { }
                try { c.mCoinsPerBlock = Convert.ToDouble(dlg.CoinsPerBlock.Text); }
                catch (Exception) { }
                c.mPOS             = dlg.POS.Checked;
                c.mIgnoreSigLen    = dlg.IgnoreSigLen.Checked;
                c.mScryptBlockHash = dlg.ScryptBlockHash.Checked;
                SaveCurrency(c);
                c.Load(currencyDir);
                return(true);
            }
            return(false);
        }
Beispiel #2
0
 private bool DoCurrencyDialog(Currency c)
 {
     CurrencyProperties dlg = new CurrencyProperties();
     dlg.NameBox.Text = c.mName;
     dlg.Symbol.Text = c.mSymbol;
     dlg.IPAddress.Text = c.mIPAddress;
     dlg.Port.Text = c.mPort.ToString();
     dlg.NetVersion.Text = c.mNetVersion.ToString();
     dlg.NetID.Text = c.mNetID.ToString();
     dlg.BlockTarget.Text = c.mBlockTarget.ToString();
     dlg.CoinsPerBlock.Text = c.mCoinsPerBlock.ToString();
     dlg.POS.Checked = c.mPOS;
     dlg.IgnoreSigLen.Checked = c.mIgnoreSigLen;
     dlg.ScryptBlockHash.Checked = c.mScryptBlockHash;
     dlg.CryptsyID.Text = c.mCryptsyMarket;
     if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         c.mName = dlg.NameBox.Text;
         c.mSymbol = dlg.Symbol.Text;
         c.mIPAddress = dlg.IPAddress.Text;
         c.mCryptsyMarket = dlg.CryptsyID.Text;
         try { c.mPort = Convert.ToUInt16(dlg.Port.Text); }
         catch (Exception) { }
         try { c.mNetVersion = Convert.ToUInt32(dlg.NetVersion.Text); }
         catch (Exception) { }
         try { c.mNetID = Convert.ToUInt32(dlg.NetID.Text); }
         catch (Exception) { }
         try { c.mBlockTarget = Convert.ToUInt32(dlg.BlockTarget.Text); }
         catch (Exception) { }
         try { c.mCoinsPerBlock = Convert.ToDouble(dlg.CoinsPerBlock.Text); }
         catch (Exception) { }
         c.mPOS = dlg.POS.Checked;
         c.mIgnoreSigLen = dlg.IgnoreSigLen.Checked;
         c.mScryptBlockHash = dlg.ScryptBlockHash.Checked;
         SaveCurrency(c);
         c.Load(currencyDir);
         return true;
     }
     return false;
 }