Esempio n. 1
0
        private void RefreshChangeKeys()
        {
            if (tcBitcoin.IsWalletInitialised)
            {
                ChangeControl changeKeys = (ChangeControl)pageChangeKeys.Content;
                changeKeys.Refresh();

                if (changeKeys.Visibility != Visibility.Visible)
                {
                    changeKeys.Visibility = Visibility.Visible;
                }
            }
        }
Esempio n. 2
0
        private void RefreshReceiptKeys()
        {
            if (tcBitcoin.IsWalletInitialised)
            {
                ChangeControl receiptKeys = (ChangeControl)pageReceiptKeys.Content;
                receiptKeys.Refresh();

                if (receiptKeys.Visibility != Visibility.Visible)
                {
                    receiptKeys.Visibility = Visibility.Visible;
                }
            }
        }
Esempio n. 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);
            }
        }