I am trying to read from the resource files to fill my dropdowns in different languages.
I found a couple of ways to do it but found two online that give me errors:
Here the error is on: "resourceSet.Cast<DictionaryEntry>
"System.Resource.ResourceSet does not contain a definition for "Select"
This one gives me this error on: "resourceSet.Select(r => (DictionaryEntry)r)"
"System.Resource.ResourceSet does not contain a definition for "Select"
What do I need to do to make these work?
Thanks,
Tom
I found a couple of ways to do it but found two online that give me errors:
Code:
ResourceSet resourceSet = LocalizedText.ResourceManager.GetResourceSet(CultureInfo.CurrentUICulture, true, true);
return from entry in resourceSet.Cast<DictionaryEntry>()
where entry.Key.ToString().StartsWith(prefix)
select new KeyValuePair<string, string>(
entry.Key.ToString().Substring(prefix.Length + 1), entry.Value.ToString());
Here the error is on: "resourceSet.Cast<DictionaryEntry>
"System.Resource.ResourceSet does not contain a definition for "Select"
Code:
ResourceSet resourceSet = LocalizedText.ResourceManager.GetResourceSet(CultureInfo.CurrentUICulture, true, true);
var resourceDictionary = resourceSet.Select(r => (DictionaryEntry)r)
.ToDictionary(dicEntry => dicEntry.Key.ToString(),
dicEntry => dicEntry.Value.ToString());
This one gives me this error on: "resourceSet.Select(r => (DictionaryEntry)r)"
"System.Resource.ResourceSet does not contain a definition for "Select"
What do I need to do to make these work?
Thanks,
Tom