11
I need to check the items from listaContrato
exist in the listaPendencia
, if I don’t exist enable
to false to be disabled on screen.
What can I do to improve the performance of foreach
below? Both lists are List<>
.
If there are solutions that are not foreach
are also welcome.
foreach (System.Windows.Controls.CheckBox item in pendenciaController.ListaCliente)
{
item.IsEnabled = false;
foreach (Pendencia pendencia in pendenciaController.ListaPendencia)
{
if (pendencia.ClienteNome.Equals(item.Content))
{
item.IsEnabled = true;
break;
}
}
}
Denis, welcome to Sopt. You are in the Portuguese-speaking community, please translate your question. I recommend that you make a Tour by the community.
– Marcelo de Andrade
Grande @Denis aqui é o Stackoverflow Brasil, idioma Português do Brasil, por favor fazer as devida traduções...
– novic
Done! Now please withdraw the negative vote =)
– Denis
No obligation to say, but the vote wasn’t my @Denis just to be clear.
– novic
I know it wasn’t...
– Denis
You could improve the context, is obliged to make these two foreach?
– novic
I edited Virgilio.
– Denis
@Marcelodeandrade I believe you have negative, I still deserve the negative?
– Denis
@Denis already removed, you no longer have negatives in question :D
– Marcelo de Andrade
Grateful! hehe
– Denis