ModelExtensions.GetAliasInfo 方法

定义

如果“nameSyntax”解析为别名,则返回对应于 A 的 IAliasSymbol。否则返回 null。

public static Microsoft.CodeAnalysis.IAliasSymbol GetAliasInfo (this Microsoft.CodeAnalysis.SemanticModel semanticModel, Microsoft.CodeAnalysis.SyntaxNode nameSyntax, System.Threading.CancellationToken cancellationToken = default);
public static Microsoft.CodeAnalysis.IAliasSymbol? GetAliasInfo (this Microsoft.CodeAnalysis.SemanticModel semanticModel, Microsoft.CodeAnalysis.SyntaxNode nameSyntax, System.Threading.CancellationToken cancellationToken = default);
static member GetAliasInfo : Microsoft.CodeAnalysis.SemanticModel * Microsoft.CodeAnalysis.SyntaxNode * System.Threading.CancellationToken -> Microsoft.CodeAnalysis.IAliasSymbol
<Extension()>
Public Function GetAliasInfo (semanticModel As SemanticModel, nameSyntax As SyntaxNode, Optional cancellationToken As CancellationToken = Nothing) As IAliasSymbol

参数

semanticModel
SemanticModel
nameSyntax
SyntaxNode

要获取其别名信息的名称。

cancellationToken
CancellationToken

可用于取消获取别名信息的取消令牌。

返回

适用于