Use better LINQ in PathConfig
This commit is contained in:
parent
28abcac463
commit
dfaf07371e
|
@ -197,7 +197,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
_pathEntries.UseRecentForRoms = RecentForROMs.Checked;
|
_pathEntries.UseRecentForRoms = RecentForROMs.Checked;
|
||||||
|
|
||||||
foreach (var t in AllPathBoxes)
|
foreach (var t in AllPathControls.OfType<TextBox>())
|
||||||
{
|
{
|
||||||
var pathEntry = _pathEntries.First(p => p.System == t.Parent.Name && p.Type == t.Name);
|
var pathEntry = _pathEntries.First(p => p.System == t.Parent.Name && p.Type == t.Name);
|
||||||
pathEntry.Path = t.Text;
|
pathEntry.Path = t.Text;
|
||||||
|
@ -214,33 +214,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerable<TextBox> AllPathBoxes
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
var allPathBoxes = new List<TextBox>();
|
|
||||||
foreach (TabPage tp in PathTabControl.TabPages)
|
|
||||||
{
|
|
||||||
allPathBoxes.AddRange(tp.Controls.OfType<TextBox>());
|
|
||||||
}
|
|
||||||
|
|
||||||
return allPathBoxes;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private IEnumerable<Control> AllPathControls
|
private IEnumerable<Control> AllPathControls
|
||||||
{
|
=> PathTabControl.TabPages.Cast<TabPage>().SelectMany(tp => tp.Controls());
|
||||||
get
|
|
||||||
{
|
|
||||||
var allPathControls = new List<Control>();
|
|
||||||
foreach (TabPage tp in PathTabControl.TabPages)
|
|
||||||
{
|
|
||||||
allPathControls.AddRange(tp.Controls());
|
|
||||||
}
|
|
||||||
|
|
||||||
return allPathControls;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void NewPathConfig_Load(object sender, EventArgs e)
|
private void NewPathConfig_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue