本文整理汇总了C#中MemberKind.ToLowerString方法的典型用法代码示例。如果您正苦于以下问题:C# MemberKind.ToLowerString方法的具体用法?C# MemberKind.ToLowerString怎么用?C# MemberKind.ToLowerString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MemberKind
的用法示例。
在下文中一共展示了MemberKind.ToLowerString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToMarkdown
/// <summary>
/// Convert the param XML element to Markdown safely.
/// </summary>
/// <param name="elements">The param XML element list.</param>
/// <param name="paramTypes">The paramater type names.</param>
/// <param name="memberKind">The member kind of the parent element.</param>
/// <returns>The generated Markdown.</returns>
/// <remarks>
/// When the parameter (a.k.a <paramref name="elements"/>) list is empty:
/// <para>If parent element kind is <see cref="MemberKind.Constructor"/> or <see cref="MemberKind.Method"/>, it returns a hint about "no parameters".</para>
/// <para>If parent element kind is not the value mentioned above, it returns an empty string.</para>
/// </remarks>
internal static IEnumerable<string> ToMarkdown(
IEnumerable<XElement> elements,
IEnumerable<string> paramTypes,
MemberKind memberKind)
{
if (!elements.Any())
{
return
memberKind != MemberKind.Constructor &&
memberKind != MemberKind.Method
? Enumerable.Empty<string>()
: new[]
{
"##### Parameters",
$"This {memberKind.ToLowerString()} has no parameters."
};
}
var markdowns = elements
.Zip(paramTypes, (element, type) => new ParamUnit(element, type))
.SelectMany(unit => unit.ToMarkdown());
var table = new[]
{
"| Name | Type | Description |",
"| ---- | ---- | ----------- |"
}
.Concat(markdowns);
return new[]
{
"##### Parameters",
string.Join("\n", table)
};
}