WinForms:加载本地化的帮助(chm)文件 [英] WinForms: Load localized help (chm) files

查看:81
本文介绍了WinForms:加载本地化的帮助(chm)文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

加载特定于语言环境(即翻译)的编译帮助文件(.chm)的最佳方法是什么?我们的安装会将它们与包含资源的附属程序集一起部署.我想重复使用.NET框架用于加载附属程序集的相同探测规则,并且我绝对希望避免编写自己的搜索算法,因为例如,我必须处理诸如此类的特定情况为"zh-CN/zh-Hans/zh-CHS".

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

我无法使用System.Windows.Forms.Help类找到任何内容,该类指示您可以提供一个CultureInfo对象来指定特定的区域性.还有其他人遇到吗? 谢谢!

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!

推荐答案

我建议不要将CHM文件与附属程序集并排部署,而应将CHM作为嵌入式资源实际包含在人造卫星本身.请记住,程序集实际上可以包含在多个文件中.进行组装和组装的是清单.

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.

这样做,您可以以编程方式请求当前语言环境的资源,让框架告诉您URL,然后将该文件位置提供给Help类.

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.

这篇关于WinForms:加载本地化的帮助(chm)文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆