static void DisplayLocalHelp(string arguments, bool embedded) { if (string.IsNullOrEmpty(arguments)) { throw new ArgumentNullException("arguments"); } if (!Help3Environment.IsLocalHelp) { return; } if (!HelpLibraryAgent.IsRunning) { HelpLibraryAgent.Start(); Thread.Sleep(0x3e8); } string helpUrl = string.Format(@"{0}{1}{2}", arguments, ProjectLanguages.GetCurrentLanguageAsHttpParam(), (embedded)?"&embedded=true":string.Empty); if (Help3Service.Config.ExternalHelp) { DisplayHelpWithShellExecute(helpUrl); return; } BrowserPane browser = ActiveHelp3Browser(); if (browser != null) { LoggingService.Info(string.Format("Help 3.0: Navigating to {0}", helpUrl)); browser.Navigate(Help3Environment.GetHttpFromMsXHelp(helpUrl)); browser.WorkbenchWindow.SelectWindow(); } }
public static string GetHttpFromMsXHelp(string helpUrl) { if (!HelpLibraryAgent.Start()) { return(helpUrl); } if (!helpUrl.StartsWith("ms-xhelp://?")) { return(helpUrl); } return(string.Format( @"http://127.0.0.1:{0}/help/{1}-{2}/ms.help?{3}", HelpLibraryAgent.PortNumber, NativeMethods.GetSessionId(), HelpLibraryAgent.ProcessId, helpUrl.Replace("ms-xhelp://?", "") )); }
Help3Service() { HelpLibraryAgent.Start(); }