SyntaxNodeExtensions.ReplaceNode Method

Definition

Overloads

ReplaceNode<TRoot>(TRoot, SyntaxNode, SyntaxNode)

Creates a new tree of nodes with the specified old node replaced with a new node.

ReplaceNode<TRoot>(TRoot, SyntaxNode, IEnumerable<SyntaxNode>)

Creates a new tree of nodes with specified old node replaced with a new nodes.

ReplaceNode<TRoot>(TRoot, SyntaxNode, SyntaxNode)

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

Creates a new tree of nodes with the specified old node replaced with a new node.

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

Type Parameters

TRoot

The type of the root node.

Parameters

root
TRoot

The root node of the tree of nodes.

oldNode
SyntaxNode

The node to be replaced; a descendant of the root node.

newNode
SyntaxNode

The new node to use in the new tree in place of the old node.

Returns

TRoot

Applies to

ReplaceNode<TRoot>(TRoot, SyntaxNode, IEnumerable<SyntaxNode>)

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

Creates a new tree of nodes with specified old node replaced with a new nodes.

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

Type Parameters

TRoot

The type of the root node.

Parameters

root
TRoot

The root of the tree of nodes.

oldNode
SyntaxNode

The node to be replaced; a descendant of the root node and an element of a list member.

newNodes
IEnumerable<SyntaxNode>

A sequence of nodes to use in the tree in place of the old node.

Returns

TRoot

Applies to