Beispiel #1
0
            private void BTLastBlockHandlerHandler(BackgroundTask bt, EventArgs e)
            {
                BTULongEventArgs btargs = (BTULongEventArgs)e;

                Program.mf.txtMessage.Text         = btargs.Timestamp.ToString();
                Program.mf.txtLastBlockNumber.Text = btargs.Value.ToString();

                string msg = "Check if geth.exe is running and synced";

                if (Program.mf.chkPaused.Checked)
                {
                    Program.mf.txtStartedMessage.Text = "Uncheck Paused checkbox";
                }
                else if (btargs.Value == 0)
                {
                    Program.mf.txtStartedMessage.Text = msg;
                }
                else if (Program.mf.txtStartedMessage.Text == msg)
                {
                    Program.mf.txtStartedMessage.Text = "";
                }
            }
Beispiel #2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            int delay = int.Parse(txtRefreshRate.Text);

            bt  = new BackgroundTask(delay);
            btt = bt.Start();

            btListener1 = new Listeners.BTLastBlockNumbersListener();
            btListener1.Subscribe(bt, 1);

            btListener2 = new Listeners.BTAccountsListener();
            btListener2.Subscribe(bt, 1);

            btListener3 = new Listeners.BTAccountsBalancesListener();
            btListener3.Subscribe(bt, 1);

            btListener4 = new Listeners.BTTxReceiptListener();
            btListener4.Subscribe(bt, 1);

            btListener5 = new Listeners.BTSyncingOutputListener();
            btListener5.Subscribe(bt, 1);
        }
Beispiel #3
0
            private void BTAccountsHandler(BackgroundTask bt, EventArgs e)
            {
                BTListStringsEventArgs btargs = (BTListStringsEventArgs)e;

                Program.mf.txtMessage.Text         = btargs.Timestamp.ToString();
                Program.mf.listAccounts.DataSource = btargs.Strings;

                int max = btargs.Strings.Count - 1;

                if (max < 0)
                {
                    max = 0;
                }
                Program.mf.numFromAddress.Maximum     = max;
                Program.mf.numToAddress.Maximum       = max;
                Program.mf.numVoteFromAddress.Maximum = max;

                if (String.IsNullOrEmpty(Program.mf.txtFromAddress.Text))
                {
                    Program.mf.numToAddress.Value  = 0;
                    Program.mf.txtFromAddress.Text = Program.mf.listAccounts.Items[(int)Program.mf.numToAddress.Value].ToString();
                }

                if (max >= 1)
                {
                    if (String.IsNullOrEmpty(Program.mf.txtToAddress.Text))
                    {
                        Program.mf.numToAddress.Value = 1;
                        Program.mf.txtToAddress.Text  = Program.mf.listAccounts.Items[(int)Program.mf.numToAddress.Value].ToString();
                    }
                    if (String.IsNullOrEmpty(Program.mf.txtVoteFromAddress.Text))
                    {
                        Program.mf.numVoteFromAddress.Value = 1;
                        Program.mf.txtVoteFromAddress.Text  = Program.mf.listAccounts.Items[(int)Program.mf.numVoteFromAddress.Value].ToString();
                    }
                }
            }
Beispiel #4
0
 public void Subscribe(BackgroundTask bt, int lId)
 {
     bt.BTAccountsBalancesEventHandlerPtr += new BackgroundTask.BTAccountsBalancesEventHandler(BTAccountsBalancesHandler);
 }
Beispiel #5
0
 public void Subscribe(BackgroundTask bt, int lId)
 {
     bt.BTSyncingOutputEventHandlerPtr += new BackgroundTask.BTSyncingOutputEventHandler(BTSyncingOutputEventHandler);
 }
Beispiel #6
0
 public void Subscribe(BackgroundTask bt, int lId)
 {
     bt.BTLastBlockNumberEventHandlerPtr += new BackgroundTask.BTLastBlockNumberEventHandler(BTLastBlockHandlerHandler);
 }
Beispiel #7
0
 public void Subscribe(BackgroundTask bt, int lId)
 {
     bt.BTTxReceiptEventHandlerPtr += new BackgroundTask.BTTxReceiptEventHandler(BTTxReceiptHandler);
 }