Skip to content

Commit

Permalink
prevent users from deleting system assets
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Zhang committed Oct 21, 2016
1 parent f786d5c commit 5080d85
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion AntSharesUI/UI/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,12 @@ private void 删除DToolStripMenuItem_Click(object sender, EventArgs e)

private void contextMenuStrip2_Opening(object sender, CancelEventArgs e)
{
删除DToolStripMenuItem1.Enabled = listView2.SelectedIndices.Count > 0;
bool enabled = listView2.SelectedIndices.Count > 0;
if (enabled)
{
enabled = listView2.SelectedItems.OfType<ListViewItem>().Select(p => (RegisterTransaction)p.Tag).All(p => p.AssetType != AssetType.AntShare && p.AssetType != AssetType.AntCoin);
}
删除DToolStripMenuItem1.Enabled = enabled;
}

private void 删除DToolStripMenuItem1_Click(object sender, EventArgs e)
Expand Down

0 comments on commit 5080d85

Please sign in to comment.