I have a situation in code where a Dictionary
seemed like the best idea - I need a collection of these objects and I need them to be acces
Doesn't this work for ya?
Dictionary<string, List<string>>
Or you could use a Tuple and have a dictionary of that:
Dictionary<string, Tuple<string, bool>>
Another idea is to store the boolean in a separate data structure, e.g. a HashSet.
Tuple is always a good solution. Furthermore in an object oriented approach, always favour composition over inheritance. Construct a composite object doing the grouping. Simply. I think you are covered with some nice and clean solutions here, from fellow stackoverflow'ers. :)
In .NET4, you could use (unchecked): Dictionary<string, Tuple<bool,string>>