Share via


SyntaxNodeExtensions.RemoveNode<TRoot> 方法

定义

创建删除指定节点的新节点树。

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

类型参数

TRoot

根节点的类型。

参数

root
TRoot

要从中删除子节点的根节点。

node
SyntaxNode

要删除的节点。

options
SyntaxRemoveOptions

用于确定节点的琐事处理方式的选项。

返回

TRoot

如果删除根节点本身,则为新根节点或 null。

适用于