How can a file based ResourceManager fall back to the embedded resources?
Our winforms application needs to be able to distribute ad-hoc translations in the *.resource format and use these in preference to t开发者_StackOverflow社区he embedded translations. Is there a way to acheive this fall back strategy?
Why the *.resource format. The .Net pattern is to use localised DLL files. See http://msdn.microsoft.com/en-us/goglobal/bb688110.aspx
I've created a new class that can contain two ResourceManager
s. These can be both a file based ResourceManager
for the ad-hoc *.resource files and an assembly based ResourceManager
for the embedded resource files.
If the ad-hock mode is enabled then the primary ResourceManager
is file based with the second ResourceManager
as an assembly based one used in a catch
block as a fall back.
If the ad-hoc mode is dissabled the primary ResourceManager
is an assembly based one and there is no secondary ResourceManager
.
精彩评论