SourceTextValueProvider<TValue> 构造函数

定义

使用给定computeValue的实例提供与SourceText实例关联的自定义值。

public SourceTextValueProvider (Func<Microsoft.CodeAnalysis.Text.SourceText,TValue> computeValue, System.Collections.Generic.IEqualityComparer<Microsoft.CodeAnalysis.Text.SourceText> sourceTextComparer = default);
public SourceTextValueProvider (Func<Microsoft.CodeAnalysis.Text.SourceText,TValue> computeValue, System.Collections.Generic.IEqualityComparer<Microsoft.CodeAnalysis.Text.SourceText>? sourceTextComparer = default);
new Microsoft.CodeAnalysis.Diagnostics.SourceTextValueProvider<'Value> : Func<Microsoft.CodeAnalysis.Text.SourceText, 'Value> * System.Collections.Generic.IEqualityComparer<Microsoft.CodeAnalysis.Text.SourceText> -> Microsoft.CodeAnalysis.Diagnostics.SourceTextValueProvider<'Value>
Public Sub New (computeValue As Func(Of SourceText, TValue), Optional sourceTextComparer As IEqualityComparer(Of SourceText) = Nothing)

参数

computeValue
Func<SourceText,TValue>

委托计算与给定 SourceText 实例关联的值。

sourceTextComparer
IEqualityComparer<SourceText>

可选相等比较器,用于确定具有相同值的等效 SourceText 实例。 如果未提供比较器, Microsoft.CodeAnalysis.Text.SourceTextComparer 则默认使用。

适用于