开发者

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

开发者 https://www.devze.com 2023-02-10 03:53 出处:网络
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

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 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消