A delegate allows you perform an action on a list type, FindAll - returns a new list, based on the conditions you put into the delegate.
List<KeyValueBool<int, String>> list = disp.List.FindAll (delegate (KeyValueBool<int, string> kvb) {
return kvb.Boolean == true;
});
KeyValueBool (class)
public class KeyValueBool<TKey, TValue> {
public TKey Key {
get;
set;
}
public TValue Value {
get;
set;
}
public Boolean Boolean {
get;
set;
}
public KeyValueBool (TKey key, TValue value, Boolean b) {
this.Key = key;
this.Value = value;
this.Boolean = b;
}
}