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); } }
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); } }