コード例 #1
0
 private void 自定义CToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (ImportCustomContractDialog dialog = new ImportCustomContractDialog())
     {
         if (dialog.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         Contract contract = dialog.GetContract();
         Program.CurrentWallet.AddContract(contract);
         listView1.SelectedIndices.Clear();
         AddContractToListView(contract, true);
     }
 }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: simplitech/neo-gui
 private void 自定义CToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (ImportCustomContractDialog dialog = new ImportCustomContractDialog())
     {
         if (dialog.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         Contract      contract = dialog.GetContract();
         WalletAccount account  = Program.CurrentWallet.CreateAccount(contract, dialog.GetKey());
         if (Program.CurrentWallet is NEP6Wallet wallet)
         {
             wallet.Save();
         }
         listView1.SelectedIndices.Clear();
         AddAccount(account, true);
     }
 }