SyntaxNode.CopyAnnotationsTo<T>(T) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Copies all SyntaxAnnotations, if any, from this SyntaxNode instance and attaches them to a new instance based on node
.
public:
generic <typename T>
where T : Microsoft::CodeAnalysis::SyntaxNode T CopyAnnotationsTo(T node);
public T CopyAnnotationsTo<T> (T node) where T : Microsoft.CodeAnalysis.SyntaxNode;
public T? CopyAnnotationsTo<T> (T? node) where T : Microsoft.CodeAnalysis.SyntaxNode;
member this.CopyAnnotationsTo : 'T -> 'T (requires 'T :> Microsoft.CodeAnalysis.SyntaxNode)
Public Function CopyAnnotationsTo(Of T As SyntaxNode) (node As T) As T
Type Parameters
- T
Parameters
- node
- T
Returns
T
Remarks
If no annotations are copied, just returns node
.
It can also be used manually to preserve annotations in a more complex tree modification, even if the type of a node changes.
Applies to
Spolupracujte s námi na GitHubu
Zdroj tohoto obsahu najdete na GitHubu, kde můžete také vytvářet a kontrolovat problémy a žádosti o přijetí změn. Další informace najdete v našem průvodci pro přispěvatele.