Fix behavior of remove in Ram Watch and Cheats too

This commit is contained in:
adelikat 2013-11-25 23:41:08 +00:00
parent 3d48a0b39e
commit af6369e14c
3 changed files with 8 additions and 6 deletions

View File

@ -395,9 +395,10 @@ namespace BizHawk.Client.EmuHawk
private void Remove()
{
if (SelectedItems.Any())
var items = SelectedItems.ToList();
if (items.Any())
{
foreach (var item in SelectedItems)
foreach (var item in items)
{
Global.CheatList.Remove(item);
}

View File

@ -450,9 +450,9 @@ namespace BizHawk.Client.EmuHawk
get { return SelectedIndices.Select(index => _searches[index]); }
}
private List<Watch> SelectedWatches
private IEnumerable<Watch> SelectedWatches
{
get { return SelectedItems.Where(x => !x.IsSeparator).ToList(); }
get { return SelectedItems.Where(x => !x.IsSeparator); }
}
private void SetRemovedMessage(int val)

View File

@ -519,9 +519,10 @@ namespace BizHawk.Client.EmuHawk
private void RemoveWatch()
{
if (SelectedItems.Any())
var items = SelectedItems.ToList();
if (items.Any())
{
foreach (var item in SelectedItems)
foreach (var item in items)
{
_watches.Remove(item);
}