Ejemplo n.º 1
0
        private void WriteRelatedLinks(XmlWriter writer, string serviceAbbreviation, string cmdletName)
        {
            var webrefLink
                = string.Format("{0}/index.html?page={1}.html&tocid={1}",
                                WebApiReferenceBaseUrl,
                                cmdletName);

            writer.WriteStartElement("relatedLinks");

            // first link must always be to the online version so get-help -online works
            WriteRelatedHelpNavigationLink(writer, "Online version:", webrefLink);

            WriteRelatedHelpNavigationLink(writer,
                                           "Common credential and region parameters: ",
                                           string.Format("{0}/items/pstoolsref-commonparams.html", WebApiReferenceBaseUrl));

            // finish with any service api reference/user guide links
            XmlDocument document;

            if (LinksCache.TryGetValue(serviceAbbreviation, out document))
            {
                ConstructLinks(writer, document, "*");
                ConstructLinks(writer, document, cmdletName);
            }

            writer.WriteEndElement();
        }
        private void WriteRelatedLinks(CmdletPageWriter writer, string serviceAbbreviation, string cmdletName)
        {
            var sb = new StringBuilder();

            // putting common credential and region parameters into a related link is the simplest
            // approach, but only do it for service cmdlets
            if (!serviceAbbreviation.Equals("Common", StringComparison.Ordinal))
            {
                XmlDocument document;
                if (LinksCache.TryGetValue(serviceAbbreviation, out document))
                {
                    ConstructLinks(sb, document, "*");
                    ConstructLinks(sb, document, cmdletName);
                }
            }

            // Add link for User Guide to all cmdlets
            AppendLink(sb, "AWS Tools for PowerShell User Guide", "http://docs.aws.amazon.com/powershell/latest/userguide/");

            writer.AddPageElement(CmdletPageWriter.RelatedLinksElementKey, sb.ToString());
        }