Beispiel #1
0
        private void changeAccountKey_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (gridControl1.DefaultView.RowCount < 2)
            {
                return;
            }
            var account = (Account)accountBindingSource.Current;
            var result  = ChangePublicKeyForm.ShowForm(this, account);

            if (result is bool && result == false)
            {
                return;
            }

            var accountKey = Keys.FirstOrDefault(p =>
                                                 p.PublicKey.X.SequenceEqual((byte[])account.AccountInfo.AccountKey.PublicKey.X) &&
                                                 p.PublicKey.Y.SequenceEqual((byte[])account.AccountInfo.AccountKey.PublicKey.Y)
                                                 );

            account.AccountInfo.AccountKey = accountKey;

            if (XtraMessageBox.Show(this,
                                    "Biztosan megváltoztatod a publikus kulcsot? A változtatás után csak az új kulcs tulajdonosa kezelheti a számlát.",
                                    "Megerősítés", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) ==
                DialogResult.Yes)
            {
                Node.Instance.ChangeAccountKey(account, result.Fee, result.Payload, account, accountKey, result.NewKey);
            }
        }
Beispiel #2
0
 public static dynamic ShowForm(IWin32Window owner, Account account)
 {
     using (ChangePublicKeyForm form = new ChangePublicKeyForm(account))
     {
         if (form.ShowDialog(owner) != DialogResult.OK)
         {
             return(false);
         }
         return(new
         {
             NewKey = form.newPublicKey.Text,
             Signer = form.signer.Text,
             Payload = form.payload.Text,
             Fee = form.fee.Value
         });
     }
 }