예제 #1
0
        private void RefreshToPay()
        {
            if (tcBitcoin.IsWalletInitialised)
            {
                InvoicesControl payments = (InvoicesControl)pageToPay.Content;
                payments.Refresh();

                if (payments.Visibility != Visibility.Visible)
                {
                    payments.Visibility = Visibility.Visible;
                }
            }
        }
예제 #2
0
        private void RefreshToReceive()
        {
            if (tcBitcoin.IsWalletInitialised)
            {
                InvoicesControl receipts = (InvoicesControl)pageToReceive.Content;
                receipts.Refresh();

                if (receipts.Visibility != Visibility.Visible)
                {
                    receipts.Visibility = Visibility.Visible;
                }
            }
        }
예제 #3
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);
            }
        }