SyntaxValueProvider.CreateSyntaxProvider<T> Method

Definition

Creates an IncrementalValueProvider<TValue> that can provide a transform over SyntaxNodes

C#
public Microsoft.CodeAnalysis.IncrementalValuesProvider<T> CreateSyntaxProvider<T>(Func<Microsoft.CodeAnalysis.SyntaxNode,System.Threading.CancellationToken,bool> predicate, Func<Microsoft.CodeAnalysis.GeneratorSyntaxContext,System.Threading.CancellationToken,T> transform);

Type Parameters

T

The type of the value the syntax node is transformed into

Parameters

predicate
Func<SyntaxNode,CancellationToken,Boolean>

A function that determines if the given SyntaxNode should be transformed

transform
Func<GeneratorSyntaxContext,CancellationToken,T>

A function that performs the transform, when predicatereturns true for a given node

Returns

An IncrementalValueProvider<TValue> that provides the results of the transformation

Applies to

Proizvod Verzije
Roslyn 4.2.0, 4.3.0, 4.4.0, 4.5.0, 4.6.0, 4.7.0, 4.8.0, 4.9.2, 4.0.1, 4.1.0, 4.12.2, 4.13.0