コード例 #1
0
        protected virtual MarkdownTable GenerateCommandParameterTable([NotNull] CommandInformation command)
        {
            var parameterTable = new MarkdownTable();

            parameterTable.AppendColumn(new MarkdownTableColumn("Name"));
            parameterTable.AppendColumn(new MarkdownTableColumn("Type"));
            parameterTable.AppendColumn(new MarkdownTableColumn("Optional"));

            foreach (var parameter in command.Parameters)
            {
                var row = new MarkdownTableRow()
                          .AppendCell(new MarkdownText(parameter.Name))
                          .AppendCell(new MarkdownText(parameter.ParameterType.Humanize()))
                          .AppendCell(new MarkdownInlineCode(parameter.IsOptional ? "yes" : "no"));

                parameterTable.AppendRow(row);
            }

            return(parameterTable);
        }