How can a file based ResourceManager fall back to the embedded resources?

751 views Asked by At

Our winforms application needs to be able to distribute ad-hoc translations in the *.resource format and use these in preference to the embedded translations. Is there a way to acheive this fall back strategy?

2

There are 2 answers

0
stevehipwell On BEST ANSWER

I've created a new class that can contain two ResourceManagers. 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.

1
Richard Schneider On

Why the *.resource format. The .Net pattern is to use localised DLL files. See http://msdn.microsoft.com/en-us/goglobal/bb688110.aspx