Example #1
0
 private void accountsButton_ItemClick(object sender, ItemClickEventArgs e)
 {
     using (var asForm = new AccountSelector())
     {
         asForm.ShowDialog(this);
     }
 }
Example #2
0
        private void buyAccount_ItemClick(object sender, ItemClickEventArgs e)
        {
            var accountSelector = new AccountSelector(Node.Instance.Accounts
                                                      .Where(p => p.AccountInfo.State == AccountState.Sale).ToList());

            if (accountSelector.ShowDialog(this) == DialogResult.OK)
            {
                if (accountBindingSource.Count < 1 || accountBindingSource.Current == null)
                {
                    XtraMessageBox.Show(this, "Nincs elegendő coinod, vagy számlád", "Hiba", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                var buyer   = (Account)accountBindingSource.Current;
                var account = accountSelector.SelectedAccount;
                if (XtraMessageBox.Show(this,
                                        $"Biztosan szeretnéd megásárolni a(z) {account.AccountNumber} számlát {account.AccountInfo.VisiblePrice} coinért? A számlát árát a {buyer.AccountNumber} számládról fizeted.",
                                        "Megerősítés", MessageBoxButtons.YesNo, MessageBoxIcon.Question,
                                        MessageBoxDefaultButton.Button2) != DialogResult.Yes)
                {
                    return;
                }
                var accountKey = Keys.FirstOrDefault(p =>
                                                     p.PublicKey.X.SequenceEqual((byte[])buyer.AccountInfo.AccountKey.PublicKey.X) &&
                                                     p.PublicKey.Y.SequenceEqual((byte[])buyer.AccountInfo.AccountKey.PublicKey.Y)
                                                     );
                buyer.AccountInfo.AccountKey = accountKey;

                Node.Instance.BuyAccount(account, 0, "", buyer, accountKey);
            }
        }
Example #3
0
        private void targetAccount_Properties_ButtonClick(object sender, ButtonPressedEventArgs e)
        {
            var selector = new AccountSelector();

            if (selector.ShowDialog(this) == DialogResult.OK)
            {
                targetAccount.Text = selector.SelectedAccount.AccountNumber.ToString();
            }
        }
Example #4
0
        private void sellerAccount_Properties_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            var selector = new AccountSelector();

            if (selector.ShowDialog(this) == DialogResult.OK)
            {
                sellerAccount.Text = selector.SelectedAccount.AccountNumber.ToString();
            }
        }