Revert "CA-179515: Move to online help"

This reverts commit 0d0cf47523.

Conflicts:

	XenAdmin/Help/HelpManager.resx
	XenModel/InvisibleMessages.Designer.cs
	XenModel/InvisibleMessages.resx
This commit is contained in:
Cheng Zhang 2016-01-28 17:35:51 +08:00
parent 4da4cf9b86
commit 4ba9981d28
5 changed files with 386 additions and 643 deletions

View File

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

File diff suppressed because it is too large Load Diff

View File

@ -2378,10 +2378,26 @@ namespace XenAdmin
public void ShowHelpTopic(string topicID)
{
string helpTopicURL = string.Format(InvisibleMessages.HELP_URL, topicID ?? Help.HelpManager.GetID("TableOfContents"));
if (!string.IsNullOrEmpty(helpTopicURL))
Program.OpenURL(helpTopicURL);
// 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);
}
}
}
public void MainWindow_HelpRequested(object sender, HelpEventArgs hlpevent)

View File

@ -114,15 +114,6 @@ 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>
@ -185,6 +176,22 @@ namespace XenAdmin {
return ResourceManager.GetString("LOG_FILENAME", resourceCulture);
}
}
/// 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.

View File

@ -135,9 +135,6 @@
<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>
@ -159,6 +156,12 @@
<data name="LOG_FILENAME" xml:space="preserve">
<value>@BRANDING_BRAND_CONSOLE@.log</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>