Tweak move bindingsource iteration

Create datasource before the foreach to avoid multiple .Where(),
possibly fixing #151
This commit is contained in:
Kaphotics
2016-07-28 18:36:02 -07:00
parent 2805f699ac
commit f63cbb4c26

View File

@@ -1060,10 +1060,11 @@ private void populateFilteredDataSources()
CB_GameOrigin.DataSource = new BindingSource(VersionDataSource.Where(g => g.Value <= SAV.MaxGameID || SAV.Generation >= 3 && g.Value == 15), null);
// Set the Move ComboBoxes too..
var moves = MoveDataSource.Where(m => m.Value <= SAV.MaxMoveID).ToArray();
foreach (ComboBox cb in new[] { CB_Move1, CB_Move2, CB_Move3, CB_Move4, CB_RelearnMove1, CB_RelearnMove2, CB_RelearnMove3, CB_RelearnMove4 })
{
cb.DisplayMember = "Text"; cb.ValueMember = "Value";
cb.DataSource = new BindingSource(MoveDataSource.Where(m => m.Value <= SAV.MaxMoveID), null);
cb.DataSource = new BindingSource(moves, null);
}
}
private Action getFieldsfromPKM;