Reputation: 45106
I suspect there is LINQ for this but I cannot figure it out
selectedKeys is a HashSet
public IEnumerable<FTSword7bitThesaurus> FTSwordsPlusSelected
{
get
{
foreach (FTSword7bit w in FTSWords7bit)
{
yield return new FTSword7bitThesaurus(this, w, selectedKeys.Contains(w.Key));
}
Debug.Write("Done FTSthersarus FTSwordsPlusSelected");
}
}
Upvotes: 0
Views: 124
Reputation: 64658
How linq does it need to be?
get
{
var result = FTSWords7bit
.Select(x => new FTSword7bitThesaurus(this, x, selectedKeys.Contains(x.Key));
Debug.Write("Done FTSthersarus FTSwordsPlusSelected");
return result;
}
Upvotes: 2
Reputation: 10427
You should use Select
return FTSWords7bit.Select(w=>
new FTSword7bitThesaurus(this, w,
selectedKeys.Contains(w.Key)));
Upvotes: 6