private static bool MatchesItem(HtmlFormElement item, string value)
{
if (item == null)
{
return false;
}
if (item.Value == null)
{
if (string.IsNullOrEmpty(value))
{
return true;
}
}
else if (item.Value.Equals(value, StringComparison.Ordinal))
{
return true;
}
if (item.Text == null)
{
if (string.IsNullOrEmpty(value))
{
return true;
}
}
else if (item.Text.Equals(value, StringComparison.Ordinal))
{
return true;
}
return false;
}