Version

GetEquivalentNode Method

For a node specified from an equivalent tree, returns a SyntaxNode in this tree which represents the same content; otherwise null.
Syntax
'Declaration
 
Public Function GetEquivalentNode( _
   ByVal node As SyntaxNode _
) As SyntaxNode
public SyntaxNode GetEquivalentNode( 
   SyntaxNode node
)

Parameters

node
The SyntaxNode for which to find the equivalent node.

Return Value

If a node is specified from an equivalent tree, returns a SyntaxNode in this tree which represents the same content; otherwise null.
Exceptions
ExceptionDescription
System.ArgumentNullExceptionOccurs when node is null.
Remarks

Callers of the AddAnnotation or AddDiagnostic methods will get returned a reference to an equivalent tree. This tree represents the same textual content as the original with extra data decorating a node in the equivalent tree. GetEquivalentNode will take a node from one tree and return the node representing the same textual content on an equivalent tree.

If the node specified is from a tree which is not equivalent, GetEquivalentNode will return null.

Trees can be tested for equivalence by seeing if their Snapshot values are the same.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also