Partager via


SyntaxNodeExtensions.InsertTokensAfter<TRoot> Méthode

Définition

Crée une arborescence de nœuds avec de nouveaux jetons insérés après le jeton spécifié.

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

Paramètres de type

TRoot

Type du nœud racine.

Paramètres

root
TRoot

Racine de l’arborescence des nœuds.

tokenInList
SyntaxToken

Jeton à insérer après. Il doit s’agir d’un élément direct d’un SyntaxTokenList (tel qu’un modificateur dans une liste de modificateurs) et d’un descendant du nœud racine. Les nouveaux jetons seront insérés après ce jeton dans cette liste. Si le jeton ne fait pas partie d’un SyntaxTokenListjeton, un InvalidOperationException jeton est levée.

newTokens
IEnumerable<SyntaxToken>

Séquence de jetons à insérer dans l’arborescence immédiatement après le jeton spécifié.

Retours

TRoot

Exceptions

Levée quand tokenInList n’est pas un élément d’un SyntaxTokenList.

S’applique à