SyntaxNodeExtensions.ReplaceToken 方法

定义

重载

ReplaceToken<TRoot>(TRoot, SyntaxToken, IEnumerable<SyntaxToken>)

使用替换为新令牌的指定旧令牌创建新的节点树。

ReplaceToken<TRoot>(TRoot, SyntaxToken, SyntaxToken)

使用替换为新令牌的指定旧令牌创建新的节点树。

ReplaceToken<TRoot>(TRoot, SyntaxToken, IEnumerable<SyntaxToken>)

Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs

使用替换为新令牌的指定旧令牌创建新的节点树。

public:
generic <typename TRoot>
 where TRoot : Microsoft::CodeAnalysis::SyntaxNode[System::Runtime::CompilerServices::Extension]
 static TRoot ReplaceToken(TRoot root, Microsoft::CodeAnalysis::SyntaxToken tokenInList, System::Collections::Generic::IEnumerable<Microsoft::CodeAnalysis::SyntaxToken> ^ newTokens);
public static TRoot ReplaceToken<TRoot> (this TRoot root, Microsoft.CodeAnalysis.SyntaxToken tokenInList, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.SyntaxToken> newTokens) where TRoot : Microsoft.CodeAnalysis.SyntaxNode;
static member ReplaceToken : 'Root * Microsoft.CodeAnalysis.SyntaxToken * seq<Microsoft.CodeAnalysis.SyntaxToken> -> 'Root (requires 'Root :> Microsoft.CodeAnalysis.SyntaxNode)
<Extension()>
Public Function ReplaceToken(Of TRoot As SyntaxNode) (root As TRoot, tokenInList As SyntaxToken, newTokens As IEnumerable(Of SyntaxToken)) As TRoot

类型参数

TRoot

根节点的类型。

参数

root
TRoot

节点树的根。

tokenInList
SyntaxToken

要替换的令牌;根节点的子代和列表成员的元素。

newTokens
IEnumerable<SyntaxToken>

要在树中用于代替指定标记的令牌序列。

返回

TRoot

适用于

ReplaceToken<TRoot>(TRoot, SyntaxToken, SyntaxToken)

Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs
Source:
SyntaxNodeExtensions.cs

使用替换为新令牌的指定旧令牌创建新的节点树。

public:
generic <typename TRoot>
 where TRoot : Microsoft::CodeAnalysis::SyntaxNode[System::Runtime::CompilerServices::Extension]
 static TRoot ReplaceToken(TRoot root, Microsoft::CodeAnalysis::SyntaxToken oldToken, Microsoft::CodeAnalysis::SyntaxToken newToken);
public static TRoot ReplaceToken<TRoot> (this TRoot root, Microsoft.CodeAnalysis.SyntaxToken oldToken, Microsoft.CodeAnalysis.SyntaxToken newToken) where TRoot : Microsoft.CodeAnalysis.SyntaxNode;
static member ReplaceToken : 'Root * Microsoft.CodeAnalysis.SyntaxToken * Microsoft.CodeAnalysis.SyntaxToken -> 'Root (requires 'Root :> Microsoft.CodeAnalysis.SyntaxNode)
<Extension()>
Public Function ReplaceToken(Of TRoot As SyntaxNode) (root As TRoot, oldToken As SyntaxToken, newToken As SyntaxToken) As TRoot

类型参数

TRoot

根节点的类型。

参数

root
TRoot

节点树的根节点。

oldToken
SyntaxToken

要替换的令牌。

newToken
SyntaxToken

要用于新树的新令牌代替旧令牌。

返回

TRoot

适用于