Exemplo n.º 1
0
 private void lockToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (CreateLockAccountDialog dialog = new CreateLockAccountDialog())
     {
         if (dialog.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         Contract contract = dialog.GetContract();
         if (contract == null)
         {
             MessageBox.Show(Strings.AddContractFailedMessage);
             return;
         }
         Program.CurrentWallet.AddContract(contract);
         listView1.SelectedIndices.Clear();
         AddContractToListView(contract, true);
     }
 }
Exemplo n.º 2
0
 private void lockToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (CreateLockAccountDialog dialog = new CreateLockAccountDialog())
     {
         if (dialog.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         Contract contract = dialog.GetContract();
         if (contract == null)
         {
             MessageBox.Show(Strings.AddContractFailedMessage);
             return;
         }
         WalletAccount account = Program.CurrentWallet.CreateAccount(contract, dialog.GetKey());
         if (Program.CurrentWallet is NEP6Wallet wallet)
         {
             wallet.Save();
         }
         listView1.SelectedIndices.Clear();
         AddAccount(account, true);
     }
 }