The problem is in the following description:
Error CS1061
"string" does not contain a setting for "ContainsIgnoreCase" and has not been possible to find any "ContainsIgnoreCase" extension method that accept a first argument of type "string" (there is a usage directive or missing assembly reference?)
I created an extension at first in a public static, but it did not work. What else can I do?
Error occurs in [Step 2.1]
namespace MyMethod
{
public static class MyExtensions
{
public static bool ContainsIgnoreCase(this string source, string search)
{
return source.IndexOf(search, StringComparison.CurrentCultureIgnoreCase) >= 0;
}
}
}
Use
private void txtBuscarJogo_TextChanged(object sender, EventArgs
{
var controles = _todosBotoes.Where(btnArcheAge => (btnArcheAge.Tag as String ?? btnArcheAge.Text).ContainsIgnoreCase(txtBuscarJogo.Text)).ToArray();
//Passo 2.2
mainPanel.Controls.Clear();
//Passo 2.3
mainPanel.Controls.AddRange(controles);
}