Пример #1
0
        /// <summary>
        /// Get the API command parameter summary.
        /// </summary>
        /// <param name="ctx">
        /// The <see cref="RegistryContext"/> holding information about the generated class.
        /// </param>
        /// <param name="command">
        /// The relative <see cref="Command"/>.
        /// </param>
        /// <param name="commandParameter">
        /// The relative <see cref="CommandParameter"/>
        /// </param>
        /// <returns>
        /// It returns the summary relative to the command <paramref name="commandParameter"/>.
        /// </returns>
        public override string QueryCommandParamSummary(RegistryContext ctx, Command command, CommandParameter commandParameter)
        {
            if (ctx == null)
            {
                throw new ArgumentNullException(nameof(ctx));
            }
            if (command == null)
            {
                throw new ArgumentNullException(nameof(command));
            }
            if (commandParameter == null)
            {
                throw new ArgumentNullException(nameof(commandParameter));
            }

            string paramSummary = $"A <see cref=\"T:{commandParameter.GetImplementationType(ctx, command)}\"/>.";

            if (_Xml != null)
            {
                XmlNamespaceManager nsmgr = new XmlNamespaceManager(new NameTable());
                nsmgr.AddNamespace("mml", "http://www.w3.org/2001/XMLSchema-instance");

                string xpath =
                    $"/refentry/refsect1[@id='parameters']/variablelist/varlistentry[term/parameter/text() = '{commandParameter.ImplementationNameRaw}']/listitem/para";

                XmlNode xmlIdentifier = _Xml.SelectSingleNode(xpath, nsmgr);
                if (xmlIdentifier != null)
                {
                    paramSummary = GetDocumentationLine(xmlIdentifier.InnerXml, _TranformCommandMan, ctx);
                }
            }

            return(paramSummary);
        }
        /// <summary>
        /// Get the API command parameter summary.
        /// </summary>
        /// <param name="ctx">
        /// The <see cref="RegistryContext"/> holding information about the generated class.
        /// </param>
        /// <param name="command">
        /// The relative <see cref="Command"/>.
        /// </param>
        /// <param name="commandParameter">
        /// The relative <see cref="CommandParameter"/>
        /// </param>
        /// <returns>
        /// It returns the summary relative to the command <paramref name="commandParameter"/>.
        /// </returns>
        public override string QueryCommandParamSummary(RegistryContext ctx, Command command, CommandParameter commandParameter)
        {
            if (ctx == null)
            {
                throw new ArgumentNullException(nameof(ctx));
            }
            if (command == null)
            {
                throw new ArgumentNullException(nameof(command));
            }
            if (commandParameter == null)
            {
                throw new ArgumentNullException(nameof(commandParameter));
            }

            return($"A <see cref=\"T:{commandParameter.GetImplementationType(ctx, command)}\"/>.");
        }