forked from neo-project/neo
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Erik Zhang
committed
Oct 25, 2016
1 parent
ea6d76f
commit cc27c99
Showing
9 changed files
with
585 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using AntShares.Wallets; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Windows.Forms; | ||
|
||
namespace AntShares.UI | ||
{ | ||
public partial class RestoreAccountsDialog : Form | ||
{ | ||
public RestoreAccountsDialog() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
public IEnumerable<Contract> GetContracts() | ||
{ | ||
return listView1.CheckedItems.OfType<ListViewItem>().Select(p => (Contract)p.Tag); | ||
} | ||
|
||
private void RestoreAccountsDialog_Load(object sender, EventArgs e) | ||
{ | ||
IEnumerable<Account> accounts = Program.CurrentWallet.GetAccounts(); | ||
accounts = accounts.Where(account => Program.CurrentWallet.GetContracts(account.PublicKeyHash).All(contract => !contract.IsStandard)); | ||
IEnumerable<Contract> contracts = accounts.Select(p => Contract.CreateSignatureContract(p.PublicKey)); | ||
listView1.Items.AddRange(contracts.Select(p => new ListViewItem(p.Address) | ||
{ | ||
Tag = p | ||
}).ToArray()); | ||
} | ||
|
||
private void listView1_ItemChecked(object sender, ItemCheckedEventArgs e) | ||
{ | ||
button1.Enabled = listView1.CheckedItems.Count > 0; | ||
} | ||
} | ||
} |
Oops, something went wrong.