WinForms: Load localized help (chm) files

岁酱吖の 提交于 2019-12-12 11:57:24

问题


What is the best way to load a locale-specific (i.e. translated) compiled help file (.chm)? Our install will deploy them alongside the satellite assemblies containing resources. I'd like to re-use the same probing rules the .NET framework uses to load the satellite assemblies, and I'd definitely like to avoid writing my own searching algorithm, because for example, I'd have to handle specific cases such as "zh-CN/zh-Hans/zh-CHS".

I can't find anything with the System.Windows.Forms.Help class that indicates that you can provide a CultureInfo object to specify a particular culture. Anybody else run across this yet? Thanks!


回答1:


Off hand, I would suggest that instead of deploying your CHM file side by side with the satellite assembly, that you actually include the CHM as an embedded resource in the satellite assembly itself. Remember that an assembly can actually be contained across multiple files. What makes an assembly and assembly is the manifest.

By doing that, you can then request the resource for the current locale programatically, let the framework tell you the URL, and then supply that file location to the Help class.



来源:https://stackoverflow.com/questions/181147/winforms-load-localized-help-chm-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!