コード例 #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)
         {
             Account account;
             try
             {
                 account = Program.CurrentWallet.Import(wif);
             }
             catch (FormatException)
             {
                 continue;
             }
             foreach (Contract contract in Program.CurrentWallet.GetContracts(account.PublicKeyHash))
             {
                 AddContractToListView(contract, true);
             }
         }
     }
 }
コード例 #2
0
 private void 导入私钥IToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (ImportPrivateKeyDialog dialog = new ImportPrivateKeyDialog())
     {
         if (dialog.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         ContractListView.SelectedIndices.Clear();
         Account account = Program.CurrentWallet.Import(dialog.WIF);
         foreach (Contract contract in Program.CurrentWallet.GetContracts(account.PublicKeyHash))
         {
             AddContractToListView(contract, true);
         }
     }
 }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: zhengger/AntShares
 private void 导入私钥IToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (ImportPrivateKeyDialog dialog = new ImportPrivateKeyDialog())
     {
         if (dialog.ShowDialog() != DialogResult.OK) return;
         ContractListView.SelectedIndices.Clear();
         Account account = Program.CurrentWallet.Import(dialog.WIF);
         foreach (Contract contract in Program.CurrentWallet.GetContracts(account.PublicKeyHash))
         {
             AddContractToListView(contract, true);
         }
     }
 }