|
|
@ -19,18 +19,16 @@ namespace MSHelpSystem.Core |
|
|
|
public static void Catalog() |
|
|
|
public static void Catalog() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (!Help3Environment.IsLocalHelp) { |
|
|
|
if (!Help3Environment.IsLocalHelp) { |
|
|
|
MessageBox.Show("You requested an offline feature in the online help mode. You have to change the mode in order to use this feature.", |
|
|
|
MessageBox.Show(StringParser.Parse("${res:AddIns.HelpViewer.OfflineFeatureRequestMsg}"), |
|
|
|
"Help Viewer", |
|
|
|
StringParser.Parse("${res:AddIns.HelpViewer.MicrosoftHelpViewerTitle}"), |
|
|
|
MessageBoxButtons.OK, |
|
|
|
MessageBoxButtons.OK, |
|
|
|
MessageBoxIcon.Error); |
|
|
|
MessageBoxIcon.Error); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
Help3Catalog catalog = Help3Service.ActiveCatalog; |
|
|
|
if (Help3Service.ActiveCatalog == null) { |
|
|
|
if (catalog == null) { |
|
|
|
throw new ArgumentNullException("Help3Service.ActiveCatalog"); |
|
|
|
throw new ArgumentNullException("c"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
string helpCatalogUrl = string.Format(@"ms-xhelp://?method=page&id=-1&product={0}&productVersion={1}&locale={2}", |
|
|
|
string helpCatalogUrl = string.Format(@"ms-xhelp://?method=page&id=-1&{0}", Help3Service.ActiveCatalog.AsMsXHelpParam); |
|
|
|
catalog.ProductCode, catalog.ProductVersion, catalog.Locale); |
|
|
|
|
|
|
|
LoggingService.Debug(string.Format("Help 3.0: {0}", helpCatalogUrl)); |
|
|
|
LoggingService.Debug(string.Format("Help 3.0: {0}", helpCatalogUrl)); |
|
|
|
DisplayLocalHelp(helpCatalogUrl); |
|
|
|
DisplayLocalHelp(helpCatalogUrl); |
|
|
|
} |
|
|
|
} |
|
|
@ -41,18 +39,16 @@ namespace MSHelpSystem.Core |
|
|
|
throw new ArgumentNullException("pageId"); |
|
|
|
throw new ArgumentNullException("pageId"); |
|
|
|
} |
|
|
|
} |
|
|
|
if (!Help3Environment.IsLocalHelp) { |
|
|
|
if (!Help3Environment.IsLocalHelp) { |
|
|
|
MessageBox.Show("You requested an offline feature in the online help mode. You have to change the mode in order to use this feature.", |
|
|
|
MessageBox.Show(StringParser.Parse("${res:AddIns.HelpViewer.OfflineFeatureRequestMsg}"), |
|
|
|
"Help Viewer", |
|
|
|
StringParser.Parse("${res:AddIns.HelpViewer.MicrosoftHelpViewerTitle}"), |
|
|
|
MessageBoxButtons.OK, |
|
|
|
MessageBoxButtons.OK, |
|
|
|
MessageBoxIcon.Error); |
|
|
|
MessageBoxIcon.Error); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
Help3Catalog catalog = Help3Service.ActiveCatalog; |
|
|
|
if (Help3Service.ActiveCatalog == null) { |
|
|
|
if (catalog == null) { |
|
|
|
throw new ArgumentNullException("Help3Service.ActiveCatalog"); |
|
|
|
throw new ArgumentNullException("c"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
string helpPageUrl = string.Format(@"ms-xhelp://?method=page&id={3}&product={0}&productVersion={1}&locale={2}", |
|
|
|
string helpPageUrl = string.Format(@"ms-xhelp://?method=page&id={1}&{0}", Help3Service.ActiveCatalog.AsMsXHelpParam, pageId); |
|
|
|
catalog.ProductCode, catalog.ProductVersion, catalog.Locale, pageId); |
|
|
|
|
|
|
|
LoggingService.Debug(string.Format("Help 3.0: {0}", helpPageUrl)); |
|
|
|
LoggingService.Debug(string.Format("Help 3.0: {0}", helpPageUrl)); |
|
|
|
DisplayLocalHelp(helpPageUrl); |
|
|
|
DisplayLocalHelp(helpPageUrl); |
|
|
|
} |
|
|
|
} |
|
|
@ -66,12 +62,10 @@ namespace MSHelpSystem.Core |
|
|
|
DisplayHelpOnMSDN(contextual); |
|
|
|
DisplayHelpOnMSDN(contextual); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
Help3Catalog catalog = Help3Service.ActiveCatalog; |
|
|
|
if (Help3Service.ActiveCatalog == null) { |
|
|
|
if (catalog == null) { |
|
|
|
throw new ArgumentNullException("Help3Service.ActiveCatalog"); |
|
|
|
throw new ArgumentNullException("c"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
string helpContextualUrl = string.Format(@"ms-xhelp://?method=f1&query={3}&product={0}&productVersion={1}&locale={2}", |
|
|
|
string helpContextualUrl = string.Format(@"ms-xhelp://?method=f1&query={1}&{0}", Help3Service.ActiveCatalog.AsMsXHelpParam, contextual); |
|
|
|
catalog.ProductCode, catalog.ProductVersion, catalog.Locale, contextual); |
|
|
|
|
|
|
|
LoggingService.Debug(string.Format("Help 3.0: {0}", helpContextualUrl)); |
|
|
|
LoggingService.Debug(string.Format("Help 3.0: {0}", helpContextualUrl)); |
|
|
|
DisplayLocalHelp(helpContextualUrl); |
|
|
|
DisplayLocalHelp(helpContextualUrl); |
|
|
|
} |
|
|
|
} |
|
|
@ -85,12 +79,10 @@ namespace MSHelpSystem.Core |
|
|
|
DisplaySearchOnMSDN(searchWords); |
|
|
|
DisplaySearchOnMSDN(searchWords); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
Help3Catalog catalog = Help3Service.ActiveCatalog; |
|
|
|
if (Help3Service.ActiveCatalog == null) { |
|
|
|
if (catalog == null) { |
|
|
|
throw new ArgumentNullException("Help3Service.ActiveCatalog"); |
|
|
|
throw new ArgumentNullException("c"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
string helpSearchUrl = string.Format(@"ms-xhelp://?method=search&query={3}&product={0}&productVersion={1}&locale={2}", |
|
|
|
string helpSearchUrl = string.Format(@"ms-xhelp://?method=search&query={1}&{0}", Help3Service.ActiveCatalog.AsMsXHelpParam, searchWords.Replace(" ", "+")); |
|
|
|
catalog.ProductCode, catalog.ProductVersion, catalog.Locale, searchWords.Replace(" ", "+")); |
|
|
|
|
|
|
|
LoggingService.Debug(string.Format("Help 3.0: {0}", helpSearchUrl)); |
|
|
|
LoggingService.Debug(string.Format("Help 3.0: {0}", helpSearchUrl)); |
|
|
|
DisplayLocalHelp(helpSearchUrl); |
|
|
|
DisplayLocalHelp(helpSearchUrl); |
|
|
|
} |
|
|
|
} |
|
|
@ -101,18 +93,16 @@ namespace MSHelpSystem.Core |
|
|
|
throw new ArgumentNullException("keywords"); |
|
|
|
throw new ArgumentNullException("keywords"); |
|
|
|
} |
|
|
|
} |
|
|
|
if (!Help3Environment.IsLocalHelp) { |
|
|
|
if (!Help3Environment.IsLocalHelp) { |
|
|
|
MessageBox.Show("You requested an offline feature in the online help mode. You have to change the mode in order to use this feature.", |
|
|
|
MessageBox.Show(StringParser.Parse("${res:AddIns.HelpViewer.OfflineFeatureRequestMsg}"), |
|
|
|
"Help Viewer", |
|
|
|
StringParser.Parse("${res:AddIns.HelpViewer.MicrosoftHelpViewerTitle}"), |
|
|
|
MessageBoxButtons.OK, |
|
|
|
MessageBoxButtons.OK, |
|
|
|
MessageBoxIcon.Error); |
|
|
|
MessageBoxIcon.Error); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
Help3Catalog catalog = Help3Service.ActiveCatalog; |
|
|
|
if (Help3Service.ActiveCatalog == null) { |
|
|
|
if (catalog == null) { |
|
|
|
throw new ArgumentNullException("Help3Service.ActiveCatalog"); |
|
|
|
throw new ArgumentNullException("c"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
string helpKeywordsUrl = string.Format(@"ms-xhelp://?method=keywords&query={3}&product={0}&productVersion={1}&locale={2}", |
|
|
|
string helpKeywordsUrl = string.Format(@"ms-xhelp://?method=keywords&query={1}&{0}", Help3Service.ActiveCatalog.AsMsXHelpParam, keywords.Replace(" ", "+")); |
|
|
|
catalog.ProductCode, catalog.ProductVersion, catalog.Locale, keywords); |
|
|
|
|
|
|
|
LoggingService.Debug(string.Format("Help 3.0: {0}", helpKeywordsUrl)); |
|
|
|
LoggingService.Debug(string.Format("Help 3.0: {0}", helpKeywordsUrl)); |
|
|
|
DisplayLocalHelp(helpKeywordsUrl); |
|
|
|
DisplayLocalHelp(helpKeywordsUrl); |
|
|
|
} |
|
|
|
} |
|
|
|