protected void OnRunFilter(object sender, EventArgs e) { bool parseSuccess = true; string failfield = "("; instructions = new List <ElementFilterInstruction> (); FiltSettings.Clear(); foreach (FilterEntryBinder feb in filtEntBind) { if (feb.Check.Active) { int ma; int mi; if (!int.TryParse(feb.MaxEnt.Text, out ma)) { parseSuccess = false; failfield += feb.id + "min val, "; } if (!int.TryParse(feb.MinEnt.Text, out mi)) { parseSuccess = false; failfield += feb.id + "max val, "; } if (parseSuccess) { FiltSettings.Add(new OldFiltSettings(feb.id, mi, ma)); ElementFilterInstruction efil = new ElementFilterInstruction(feb.id, mi, ma); instructions.Add(efil); } } } if (parseSuccess) { MainData.RunElementFilter(instructions); this.Destroy(); } else { MainData.ShowMessageWindow("The following entries were in error: " + failfield, false); } }