/// <summary> /// Initialize help providers. /// </summary> /// <remarks> /// Currently we hardcode the sequence of help provider initialization. /// In the longer run, we probably will load help providers based on some provider catalog. That /// will allow new providers to be defined by customer. /// </remarks> private void InitializeHelpProviders() { HelpProvider helpProvider = null; helpProvider = new AliasHelpProvider(this); _helpProviders.Add(helpProvider); helpProvider = new ScriptCommandHelpProvider(this); _helpProviders.Add(helpProvider); helpProvider = new CommandHelpProvider(this); _helpProviders.Add(helpProvider); helpProvider = new ProviderHelpProvider(this); _helpProviders.Add(helpProvider); helpProvider = new PSClassHelpProvider(this); _helpProviders.Add(helpProvider); /* TH Bug#3141590 - Disable DscResourceHelp for ClientRTM due to perf issue. #if !CORECLR // TODO:CORECLR Add this back in once we support Get-DscResource * helpProvider = new DscResourceHelpProvider(this); * _helpProviders.Add(helpProvider); #endif */ helpProvider = new HelpFileHelpProvider(this); _helpProviders.Add(helpProvider); helpProvider = new DefaultHelpProvider(this); _helpProviders.Add(helpProvider); }
private void InitializeHelpProviders() { HelpProvider provider = null; provider = new AliasHelpProvider(this); this._helpProviders.Add(provider); provider = new ScriptCommandHelpProvider(this); this._helpProviders.Add(provider); provider = new CommandHelpProvider(this); this._helpProviders.Add(provider); provider = new ProviderHelpProvider(this); this._helpProviders.Add(provider); provider = new HelpFileHelpProvider(this); this._helpProviders.Add(provider); provider = new FaqHelpProvider(this); this._helpProviders.Add(provider); provider = new GlossaryHelpProvider(this); this._helpProviders.Add(provider); provider = new GeneralHelpProvider(this); this._helpProviders.Add(provider); provider = new DefaultHelpProvider(this); this._helpProviders.Add(provider); }
private void LoadHelpFile(ProviderInfo providerInfo) { using (ProviderHelpProvider.tracer.TraceMethod()) { string str1 = providerInfo != null ? providerInfo.HelpFile : throw ProviderHelpProvider.tracer.NewArgumentNullException(nameof(providerInfo)); if (string.IsNullOrEmpty(str1) || this._helpFiles.Contains((object)str1)) { return; } string file = str1; PSSnapInInfo psSnapIn = providerInfo.PSSnapIn; Collection <string> searchPaths = new Collection <string>(); if (psSnapIn != null) { file = Path.Combine(psSnapIn.ApplicationBase, str1); } else if (providerInfo.Module != null && !string.IsNullOrEmpty(providerInfo.Module.Path)) { file = Path.Combine(providerInfo.Module.ModuleBase, str1); } else { searchPaths.Add(this.GetDefaultShellSearchPath()); searchPaths.Add(ProviderHelpProvider.GetProviderAssemblyPath(providerInfo)); } string str2 = MUIFileSearcher.LocateFile(file, searchPaths); if (string.IsNullOrEmpty(str2)) { throw new FileNotFoundException(str1); } XmlDocument xmlDocument = new XmlDocument(); xmlDocument.Load(str2); this._helpFiles[(object)str1] = (object)0; XmlNode xmlNode = (XmlNode)null; if (xmlDocument.HasChildNodes) { for (int i = 0; i < xmlDocument.ChildNodes.Count; ++i) { XmlNode childNode = xmlDocument.ChildNodes[i]; if (childNode.NodeType == XmlNodeType.Element && string.Compare(childNode.Name, "helpItems", StringComparison.OrdinalIgnoreCase) == 0) { xmlNode = childNode; break; } } } if (xmlNode == null) { return; } using (this.HelpSystem.Trace(str2)) { if (!xmlNode.HasChildNodes) { return; } for (int i = 0; i < xmlNode.ChildNodes.Count; ++i) { XmlNode childNode = xmlNode.ChildNodes[i]; if (childNode.NodeType == XmlNodeType.Element && string.Compare(childNode.Name, "providerHelp", StringComparison.OrdinalIgnoreCase) == 0) { HelpInfo helpInfo = (HelpInfo)ProviderHelpInfo.Load(childNode); if (helpInfo != null) { this.HelpSystem.TraceErrors(helpInfo.Errors); helpInfo.FullHelp.TypeNames.Insert(0, string.Format((IFormatProvider)CultureInfo.InvariantCulture, "ProviderHelpInfo#{0}#{1}", (object)providerInfo.PSSnapInName, (object)helpInfo.Name)); if (!string.IsNullOrEmpty(providerInfo.PSSnapInName)) { helpInfo.FullHelp.Properties.Add((PSPropertyInfo) new PSNoteProperty("PSSnapIn", (object)providerInfo.PSSnapIn)); helpInfo.FullHelp.TypeNames.Insert(1, string.Format((IFormatProvider)CultureInfo.InvariantCulture, "ProviderHelpInfo#{0}", (object)providerInfo.PSSnapInName)); } this.AddCache(providerInfo.PSSnapInName + "\\" + helpInfo.Name, helpInfo); } } } } } }
private void InitializeHelpProviders() { HelpProvider provider = null; provider = new AliasHelpProvider(this); this._helpProviders.Add(provider); provider = new ScriptCommandHelpProvider(this); this._helpProviders.Add(provider); provider = new CommandHelpProvider(this); this._helpProviders.Add(provider); provider = new ProviderHelpProvider(this); this._helpProviders.Add(provider); provider = new HelpFileHelpProvider(this); this._helpProviders.Add(provider); provider = new FaqHelpProvider(this); this._helpProviders.Add(provider); provider = new GlossaryHelpProvider(this); this._helpProviders.Add(provider); provider = new GeneralHelpProvider(this); this._helpProviders.Add(provider); provider = new DefaultHelpProvider(this); this._helpProviders.Add(provider); }
/// <summary> /// Initialize help providers. /// </summary> /// <remarks> /// Currently we hardcode the sequence of help provider initialization. /// In the longer run, we probably will load help providers based on some provider catalog. That /// will allow new providers to be defined by customer. /// </remarks> private void InitializeHelpProviders() { HelpProvider helpProvider = null; helpProvider = new AliasHelpProvider(this); _helpProviders.Add(helpProvider); helpProvider = new ScriptCommandHelpProvider(this); _helpProviders.Add(helpProvider); helpProvider = new CommandHelpProvider(this); _helpProviders.Add(helpProvider); helpProvider = new ProviderHelpProvider(this); _helpProviders.Add(helpProvider); helpProvider = new PSClassHelpProvider(this); _helpProviders.Add(helpProvider); /* TH Bug#3141590 - Disable DscResourceHelp for ClientRTM due to perf issue. #if !CORECLR // TODO:CORECLR Add this back in once we support Get-DscResource helpProvider = new DscResourceHelpProvider(this); _helpProviders.Add(helpProvider); #endif */ helpProvider = new HelpFileHelpProvider(this); _helpProviders.Add(helpProvider); helpProvider = new FaqHelpProvider(this); _helpProviders.Add(helpProvider); helpProvider = new GlossaryHelpProvider(this); _helpProviders.Add(helpProvider); helpProvider = new GeneralHelpProvider(this); _helpProviders.Add(helpProvider); helpProvider = new DefaultHelpProvider(this); _helpProviders.Add(helpProvider); }