Simplify this function
This commit is contained in:
parent
bbd21eb775
commit
4cfaf74837
|
@ -191,23 +191,11 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void btnRemove_Click(object sender, EventArgs e)
|
private void btnRemove_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
//ToDo:
|
if (FileSelectorPanel.Controls.Count > 0)
|
||||||
//Make this better?
|
|
||||||
//We need to have i at 1 and not zero because Controls Count doesn't start at zero (sort of)
|
|
||||||
var i = 1;
|
|
||||||
//For Each Control box we have, loop
|
|
||||||
foreach (Control ctrl in FileSelectorPanel.Controls)
|
|
||||||
{
|
{
|
||||||
//if we are at the last box, then remove it.
|
FileSelectorPanel.Controls[^1].Dispose();
|
||||||
if ((i == FileSelectorPanel.Controls.Count))
|
Recalculate();
|
||||||
{
|
|
||||||
ctrl.Dispose();
|
|
||||||
}
|
|
||||||
//One to our looper
|
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Recalculate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void FileSelector_NameChanged(object sender, EventArgs e)
|
private void FileSelector_NameChanged(object sender, EventArgs e)
|
||||||
|
|
Loading…
Reference in New Issue