本文整理汇总了C#中IMethodSymbol.IsAwaitable方法的典型用法代码示例。如果您正苦于以下问题:C# IMethodSymbol.IsAwaitable方法的具体用法?C# IMethodSymbol.IsAwaitable怎么用?C# IMethodSymbol.IsAwaitable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMethodSymbol
的用法示例。
在下文中一共展示了IMethodSymbol.IsAwaitable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetAwaitableUsage
protected IList<SymbolDisplayPart> GetAwaitableUsage(IMethodSymbol method, SemanticModel semanticModel, int position)
{
if (method.IsAwaitable(semanticModel, position))
{
return method.ToAwaitableParts(SyntaxFacts.GetText(SyntaxKind.AwaitKeyword), "x", semanticModel, position);
}
return SpecializedCollections.EmptyList<SymbolDisplayPart>();
}
示例2: AddDescriptionForMethod
private void AddDescriptionForMethod(IMethodSymbol method)
{
// TODO : show duplicated member case
// TODO : a way to check whether it is a member call off dynamic type?
var awaitable = method.IsAwaitable(_semanticModel, _position);
var extension = method.IsExtensionMethod || method.MethodKind == MethodKind.ReducedExtension;
if (awaitable && extension)
{
AddAwaitableExtensionPrefix();
}
else if (awaitable)
{
AddAwaitablePrefix();
}
else if (extension)
{
AddExtensionPrefix();
}
AddToGroup(SymbolDescriptionGroups.MainDescription,
ToMinimalDisplayParts(method, s_memberSignatureDisplayFormat));
if (awaitable)
{
AddAwaitableUsageText(method, _semanticModel, _position);
}
}
开发者ID:reudismam,项目名称:roslyn,代码行数:27,代码来源:AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs