Satellite assemblies and resource files
-
Hi, I am trying to read a string from a specific resource file embedded in a satellite assembly using the resource manager. This works fine (see http://www.codeproject.com/script/comments/forums.asp?msg=2232299&forumid=12076#xx2232299xx ). I managed to use the ResourManager to read a required string in the usual way : ResourceManager.GetString("key"). However, i am looking for a way of reading all keys and values within a particular resource file at one go (e.g I want to read all the 100 entries in a resource file into a list without having to pass the "key" each time). Can you please help me on this.:doh: Thanks Krg
-
Hi, I am trying to read a string from a specific resource file embedded in a satellite assembly using the resource manager. This works fine (see http://www.codeproject.com/script/comments/forums.asp?msg=2232299&forumid=12076#xx2232299xx ). I managed to use the ResourManager to read a required string in the usual way : ResourceManager.GetString("key"). However, i am looking for a way of reading all keys and values within a particular resource file at one go (e.g I want to read all the 100 entries in a resource file into a list without having to pass the "key" each time). Can you please help me on this.:doh: Thanks Krg
Hi, Sorry i did find the answer myself. Its as simple as getting an Enumerator on the ResourceManager's ResourceSet. Please find the code below if this might help someday: ResourceSet resourceSet = _resManager.GetResourceSet(new CultureInfo(userLanguage), true, true); IDictionaryEnumerator eDict = resourceSet.GetEnumerator(); string x = string.Empty; while(eDict.MoveNext()) //Loop in Resource Set { x += " [" + eDict.Entry.Key + "] --> [" + eDict.Entry.Value + "]"; }