CA-179515: Move to online help

Launch online help instead of XenCenter.chm
This commit is contained in:
Mihaela Stoica 2015-10-09 12:36:30 +01:00
parent d1fb03f0a1
commit 0d0cf47523
5 changed files with 645 additions and 386 deletions

View File

@ -53,9 +53,7 @@ namespace XenAdmin.Help
internal static string GetID(string pageref)
{
int id;
string s = resources.GetString(pageref);
return s != null && int.TryParse(s, out id) ? s : null;
return resources.GetString(pageref);
}
public static void Launch(string pageref)

File diff suppressed because it is too large Load Diff

View File

@ -2409,26 +2409,10 @@ namespace XenAdmin
public void ShowHelpTopic(string topicID)
{
// Abandon all hope, ye who enter here: if you're ever tempted to directly invoke hh.exe, see first:
// JAXC-43: Online help doesn't work if install XenCenter into the path that contains special characters.
// hh.exe can't seem to cope with certain multi-byte characters in the path to the chm.
// System.Windows.Forms.Help.ShowHelp() can cope with the special characters in the path, but has the
// irritating behaviour that the launched help is always on top of the app window (CA-8863).
// So we show the help 'on top' of an invisible dummy Form.
using (var helpForm = new Form())
{
string chm = Path.Combine(Program.AssemblyDir, InvisibleMessages.MAINWINDOW_HELP_PATH);
if (topicID == null)
{
// Show TOC
System.Windows.Forms.Help.ShowHelp(helpForm, chm, HelpNavigator.TableOfContents);
}
else
{
System.Windows.Forms.Help.ShowHelp(helpForm, chm, HelpNavigator.TopicId, topicID);
}
}
string helpTopicURL = string.Format(InvisibleMessages.HELP_URL, topicID ?? Help.HelpManager.GetID("TableOfContents"));
if (!string.IsNullOrEmpty(helpTopicURL))
Program.OpenURL(helpTopicURL);
}
public void MainWindow_HelpRequested(object sender, HelpEventArgs hlpevent)

View File

@ -114,6 +114,15 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to http://docs.citrix.com/en-us/urls/{0}.html.
/// </summary>
public static string HELP_URL {
get {
return ResourceManager.GetString("HELP_URL", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to http://www.citrix.com/xenserver.
/// </summary>
@ -168,24 +177,6 @@ namespace XenAdmin {
}
}
/// <summary>
/// Looks up a localized string similar to -mapid {0} {1}.
/// </summary>
public static string MAINWINDOW_HELP_PARAMS {
get {
return ResourceManager.GetString("MAINWINDOW_HELP_PARAMS", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Help\XenCenter.chm.
/// </summary>
public static string MAINWINDOW_HELP_PATH {
get {
return ResourceManager.GetString("MAINWINDOW_HELP_PATH", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Home.htm.
/// </summary>

View File

@ -135,6 +135,9 @@
<data name="HEALTH_CHECK_PRIVACY_STATEMENT_URL" xml:space="preserve">
<value>https://cis.citrix.com/legal/</value>
</data>
<data name="HELP_URL" xml:space="preserve">
<value>http://docs.citrix.com/en-us/urls/{0}.html</value>
</data>
<data name="HOMEPAGE" xml:space="preserve">
<value>http://www.citrix.com/xenserver</value>
</data>
@ -153,12 +156,6 @@
<data name="LOCALE" xml:space="preserve">
<value>en-US</value>
</data>
<data name="MAINWINDOW_HELP_PARAMS" xml:space="preserve">
<value>-mapid {0} {1}</value>
</data>
<data name="MAINWINDOW_HELP_PATH" xml:space="preserve">
<value>Help\XenCenter.chm</value>
</data>
<data name="MAINWINDOW_HOME_PATH" xml:space="preserve">
<value>Home.htm</value>
</data>