Пример #1
0
 private void importWIFToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (ImportPrivateKeyDialog dialog = new ImportPrivateKeyDialog())
     {
         if (dialog.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         listView1.SelectedIndices.Clear();
         foreach (string wif in dialog.WifStrings)
         {
             KeyPair key;
             try
             {
                 key = Program.CurrentWallet.Import(wif);
             }
             catch (FormatException)
             {
                 continue;
             }
             foreach (Contract contract in Program.CurrentWallet.GetContracts(key.PublicKeyHash))
             {
                 AddContractToListView(contract, true);
             }
         }
     }
 }
Пример #2
0
 private void importWIFToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (ImportPrivateKeyDialog dialog = new ImportPrivateKeyDialog())
     {
         if (dialog.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         listView1.SelectedIndices.Clear();
         foreach (string wif in dialog.WifStrings)
         {
             WalletAccount account;
             try
             {
                 account = Program.CurrentWallet.Import(wif);
             }
             catch (FormatException)
             {
                 continue;
             }
             AddAccount(account, true);
         }
         if (Program.CurrentWallet is NEP6Wallet wallet)
         {
             wallet.Save();
         }
     }
 }