how to pass a input parameter _HeaderToSearch in Predicate

Then, how to pass a input parameter _HeaderToSearch in Predicate?

1. To do that, we need to a new object called ListMatcher -

public class ListMatcher
{
private string _HeaderToSearch;
public ListMatcher(string headerToSearch)
{
_HeaderToSearch = headerToSearch;
}
public bool Predicate(SprintBacklogItem item)
{
return item.Title.StartsWith(_HeaderToSearch, StringComparison.InvariantCultureIgnoreCase);
}
}  

2. Next , I initialized the ListMatcher object and use the HeaderToSearch  to filter the items- 

ListMatcher matcher = new ListMatcher("QA");
this.FindAll(matcher.Predicate);

Done. how to pass a input parameter _HeaderToSearch in Predicate

上一篇:安装XenApp 6 Error:exited with error code -1


下一篇:IE8 7 6 css hacks