本文整理汇总了C#中IMethodSymbol.GetOriginalUnreducedDefinition方法的典型用法代码示例。如果您正苦于以下问题:C# IMethodSymbol.GetOriginalUnreducedDefinition方法的具体用法?C# IMethodSymbol.GetOriginalUnreducedDefinition怎么用?C# IMethodSymbol.GetOriginalUnreducedDefinition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMethodSymbol
的用法示例。
在下文中一共展示了IMethodSymbol.GetOriginalUnreducedDefinition方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetPreambleParts
private IList<SymbolDisplayPart> GetPreambleParts(
IMethodSymbol method,
SemanticModel semanticModel,
int position)
{
var result = new List<SymbolDisplayPart>();
var awaitable = method.GetOriginalUnreducedDefinition().IsAwaitableNonDynamic(semanticModel, position);
var extension = method.GetOriginalUnreducedDefinition().IsExtensionMethod();
if (awaitable && extension)
{
result.Add(Punctuation(SyntaxKind.OpenParenToken));
result.Add(Text(CSharpFeaturesResources.awaitable));
result.Add(Punctuation(SyntaxKind.CommaToken));
result.Add(Text(CSharpFeaturesResources.extension));
result.Add(Punctuation(SyntaxKind.CloseParenToken));
result.Add(Space());
}
else if (awaitable)
{
result.Add(Punctuation(SyntaxKind.OpenParenToken));
result.Add(Text(CSharpFeaturesResources.awaitable));
result.Add(Punctuation(SyntaxKind.CloseParenToken));
result.Add(Space());
}
else if (extension)
{
result.Add(Punctuation(SyntaxKind.OpenParenToken));
result.Add(Text(CSharpFeaturesResources.extension));
result.Add(Punctuation(SyntaxKind.CloseParenToken));
result.Add(Space());
}
result.AddRange(method.ReturnType.ToMinimalDisplayParts(semanticModel, position));
result.Add(Space());
var containingType = GetContainingType(method);
if (containingType != null)
{
result.AddRange(containingType.ToMinimalDisplayParts(semanticModel, position));
result.Add(Punctuation(SyntaxKind.DotToken));
}
result.Add(new SymbolDisplayPart(SymbolDisplayPartKind.MethodName, method, method.Name));
result.Add(Punctuation(SyntaxKind.LessThanToken));
return result;
}
示例2: GetMethodGroupPreambleParts
private IEnumerable<SymbolDisplayPart> GetMethodGroupPreambleParts(
IMethodSymbol method,
SemanticModel semanticModel,
int position)
{
var result = new List<SymbolDisplayPart>();
var awaitable = method.GetOriginalUnreducedDefinition().IsAwaitableNonDynamic(semanticModel, position);
var extension = method.GetOriginalUnreducedDefinition().IsExtensionMethod();
if (awaitable && extension)
{
result.Add(Punctuation(SyntaxKind.OpenParenToken));
result.Add(Text(CSharpFeaturesResources.Awaitable));
result.Add(Punctuation(SyntaxKind.CommaToken));
result.Add(Text(CSharpFeaturesResources.Extension));
result.Add(Punctuation(SyntaxKind.CloseParenToken));
result.Add(Space());
}
else if (awaitable)
{
result.Add(Punctuation(SyntaxKind.OpenParenToken));
result.Add(Text(CSharpFeaturesResources.Awaitable));
result.Add(Punctuation(SyntaxKind.CloseParenToken));
result.Add(Space());
}
else if (extension)
{
result.Add(Punctuation(SyntaxKind.OpenParenToken));
result.Add(Text(CSharpFeaturesResources.Extension));
result.Add(Punctuation(SyntaxKind.CloseParenToken));
result.Add(Space());
}
result.AddRange(method.ToMinimalDisplayParts(semanticModel, position, MinimallyQualifiedWithoutParametersFormat));
result.Add(Punctuation(SyntaxKind.OpenParenToken));
return result;
}