Exemplo n.º 1
0
        private void RefreshTransactions()
        {
            if (tcBitcoin.IsWalletInitialised)
            {
                TxControl txIds = (TxControl)pageTransactions.Content;
                txIds.Refresh();

                if (txIds.Visibility != Visibility.Visible)
                {
                    txIds.Visibility = Visibility.Visible;
                }
            }
        }
Exemplo n.º 2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                var txIds = new TxControl(tvWallet, tcBitcoin);
                txIds.OnBalance         += tvWallet_OnBalance;
                txIds.Visibility         = Visibility.Hidden;
                pageTransactions.Content = txIds;

                var toReceive = new InvoicesControl(tvWallet, tcBitcoin, CashMode.Income);
                toReceive.OnBalance  += tvWallet_OnBalance;
                toReceive.Visibility  = Visibility.Hidden;
                pageToReceive.Content = toReceive;

                var toPay = new InvoicesControl(tvWallet, tcBitcoin, CashMode.Expense);
                toPay.OnBalance  += tvWallet_OnBalance;
                toPay.Visibility  = Visibility.Hidden;
                pageToPay.Content = toPay;

                var receiptKeys = new ChangeControl(tvWallet, tcBitcoin, CoinChangeType.Receipt);
                receiptKeys.OnBalance  += tvWallet_OnBalance;
                receiptKeys.Visibility  = Visibility.Hidden;
                pageReceiptKeys.Content = receiptKeys;

                var changeKeys = new ChangeControl(tvWallet, tcBitcoin, CoinChangeType.Change);
                changeKeys.OnBalance  += tvWallet_OnBalance;
                changeKeys.Visibility  = Visibility.Hidden;
                pageChangeKeys.Content = changeKeys;

                if (Properties.Settings.Default.APIAddress.Length > 0)
                {
                    tcBitcoin.ApiAddress = new Uri(Properties.Settings.Default.APIAddress);
                }
                tcBitcoin.MinersFee = (MinerRates.MiningSpeed)Properties.Settings.Default.MinersFeeSpeed;

                using (TCNodeConfig nodeConfig = new TCNodeConfig())
                {
                    SqlServerName  = nodeConfig.SqlServerName;
                    Authentication = nodeConfig.Authentication;
                    SqlUserName    = nodeConfig.SqlUserName;
                    DatabaseName   = nodeConfig.DatabaseName;
                }

                if (SqlServerConnect())
                {
                    ConnectionFooter();
                }
                else
                {
                    SetSqlConnection();
                }

                if (Properties.Settings.Default.WindowHeight > 0)
                {
                    Height = Properties.Settings.Default.WindowHeight;
                    Width  = Properties.Settings.Default.WindowWidth;
                    Top    = Properties.Settings.Default.WindowTop;
                    Left   = Properties.Settings.Default.WindowLeft;
                }
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message, Title, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }