I'm using a ResourceReader to read an embedded resx resource and I want to store it at a class level in a member variable. I'm want to store it as a HybridDictionary but don't see an easy way of doing it.
Class member
private IEnumerable<DictionaryEntry> dictionary;
Class initalize
Assembly asm = Assembly.GetExecutingAssembly();
Stream resourceStream = asm.GetManifestResourceStream("MagicBeans");
using (ResourceReader r = new ResourceReader(resourceStream))
{
IEnumerable<DictionaryEntry> dictionary = r.OfType<DictionaryEntry>();
}
Properties
public string Something { get { return dictionary["Something"].Value; }}
public string ThatThing { get { return dictionary["ThatThing"].Value; }}
However, the IEnumerable<DictionaryEntry>
isn't working the way I like and Im currently looking at doing something LINQ'y like; .First(x => x.Key=="Something").Value