本文整理汇总了C#中ValueSource类的典型用法代码示例。如果您正苦于以下问题:C# ValueSource类的具体用法?C# ValueSource怎么用?C# ValueSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ValueSource类属于命名空间,在下文中一共展示了ValueSource类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TaxonomyFacetSumValueSource
/// <summary>
/// Aggreggates float facet values from the provided
/// <see cref="ValueSource"/>, and pulls ordinals from the
/// provided <see cref="OrdinalsReader"/>.
/// </summary>
public TaxonomyFacetSumValueSource(OrdinalsReader ordinalsReader, TaxonomyReader taxoReader,
FacetsConfig config, FacetsCollector fc, ValueSource valueSource)
: base(ordinalsReader.IndexFieldName, taxoReader, config)
{
this.ordinalsReader = ordinalsReader;
SumValues(fc.GetMatchingDocs(), fc.KeepScores, valueSource);
}
示例2: ReciprocalFloatFunction
/// <summary>
/// f(source) = a/(m*float(source)+b)
/// </summary>
public ReciprocalFloatFunction(ValueSource source, float m, float a, float b)
{
this.source = source;
this.m = m;
this.a = a;
this.b = b;
}
示例3: ProjectState
private ProjectState(
ProjectInfo projectInfo,
HostLanguageServices languageServices,
SolutionServices solutionServices,
IEnumerable<DocumentId> documentIds,
IEnumerable<DocumentId> additionalDocumentIds,
ImmutableDictionary<DocumentId, DocumentState> documentStates,
ImmutableDictionary<DocumentId, TextDocumentState> additionalDocumentStates,
AsyncLazy<VersionStamp> lazyLatestDocumentVersion,
AsyncLazy<VersionStamp> lazyLatestDocumentTopLevelChangeVersion,
ValueSource<ProjectStateChecksums> lazyChecksums)
{
_projectInfo = projectInfo;
_solutionServices = solutionServices;
_languageServices = languageServices;
_documentIds = documentIds.ToImmutableReadOnlyListOrEmpty();
_additionalDocumentIds = additionalDocumentIds.ToImmutableReadOnlyListOrEmpty();
_documentStates = documentStates;
_additionalDocumentStates = additionalDocumentStates;
_lazyLatestDocumentVersion = lazyLatestDocumentVersion;
_lazyLatestDocumentTopLevelChangeVersion = lazyLatestDocumentTopLevelChangeVersion;
// for now, let it re-calculate if anything changed.
// TODO: optimize this so that we only re-calcuate checksums that are actually changed
_lazyChecksums = new AsyncLazy<ProjectStateChecksums>(ComputeChecksumsAsync, cacheResult: true);
}
示例4: TryGetSource
public bool TryGetSource(FileKey key, out ValueSource<AssemblyMetadata> source)
{
lock (_gate)
{
return _metadataCache.TryGetValue(key, out source);
}
}
示例5: State
protected State(ValueSource<Compilation> compilation, Compilation declarationOnlyCompilation)
{
this.Compilation = compilation;
this.DeclarationOnlyCompilation = declarationOnlyCompilation;
// Declaration-only compilations should never have any references
Contract.ThrowIfTrue(declarationOnlyCompilation != null && declarationOnlyCompilation.ExternalReferences.Any());
}
示例6: RangeMapFloatFunction
public RangeMapFloatFunction(ValueSource source, float min, float max, ValueSource target, ValueSource def)
{
this.source = source;
this.min = min;
this.max = max;
this.target = target;
this.defaultVal = def;
}
示例7: TextDocumentState
protected TextDocumentState(
SolutionServices solutionServices,
DocumentInfo info,
ValueSource<TextAndVersion> textSource)
{
this.solutionServices = solutionServices;
this.info = info;
this.textSource = textSource;
}
示例8: DistanceToShapeValueSource
private readonly double nullValue;//computed
public DistanceToShapeValueSource(ValueSource shapeValueSource, IPoint queryPoint,
double multiplier, SpatialContext ctx)
{
this.shapeValueSource = shapeValueSource;
this.queryPoint = queryPoint;
this.multiplier = multiplier;
this.distCalc = ctx.DistCalc;
this.nullValue =
(ctx.IsGeo ? 180 * multiplier : double.MaxValue);
}
示例9: CreateLazyFullyParsedTree
private static ValueSource<TreeAndVersion> CreateLazyFullyParsedTree(
ValueSource<TextAndVersion> newTextSource,
string filePath,
ParseOptions options,
HostLanguageServices languageServices,
PreservationMode mode = PreservationMode.PreserveValue)
{
return new AsyncLazy<TreeAndVersion>(
c => FullyParseTreeAsync(newTextSource, filePath, options, languageServices, mode, c),
cacheResult: true);
}
示例10: InProgressState
public InProgressState(
ValueSource<Compilation> inProgressCompilationSource,
ImmutableList<ValueTuple<ProjectState, CompilationTranslationAction>> intermediateProjects)
: base(inProgressCompilationSource)
{
Contract.ThrowIfNull(inProgressCompilationSource);
Contract.ThrowIfNull(inProgressCompilationSource.GetValue());
Contract.ThrowIfNull(intermediateProjects);
Contract.ThrowIfFalse(intermediateProjects.Count > 0);
this.IntermediateProjects = intermediateProjects;
}
示例11: DocTermsIndexDocValues
protected DocTermsIndexDocValues(ValueSource vs, AtomicReaderContext context, string field)
{
try
{
termsIndex = FieldCache.DEFAULT.GetTermsIndex(context.AtomicReader, field);
}
catch (Exception e)
{
throw new DocTermsIndexException(field, e);
}
this.vs = vs;
}
示例12: find_values_invokes_the_fubu_request
public void find_values_invokes_the_fubu_request()
{
var request = new InMemoryFubuRequest();
var address = new Address();
request.Set(address);
var source = new ValueSource<Address>(request);
source.FindValues().ShouldBeOfType<SimpleValues<Address>>()
.Subject.ShouldBeTheSameAs(address);
}
示例13: InProgressState
public InProgressState(
ValueSource<Compilation> inProgressCompilationSource,
ImmutableArray<ValueTuple<ProjectState, CompilationTranslationAction>> intermediateProjects)
: base(inProgressCompilationSource)
{
Contract.ThrowIfNull(inProgressCompilationSource);
Contract.ThrowIfNull(inProgressCompilationSource.GetValue());
Contract.ThrowIfTrue(intermediateProjects.IsDefault);
Contract.ThrowIfFalse(intermediateProjects.Length > 0);
this.IntermediateProjects = intermediateProjects;
}
示例14: DocumentState
private DocumentState(
HostLanguageServices languageServices,
SolutionServices solutionServices,
DocumentInfo info,
ParseOptions options,
ValueSource<TextAndVersion> textSource,
ValueSource<TreeAndVersion> treeSource)
: base(solutionServices, info, textSource)
{
_languageServices = languageServices;
_options = options;
_treeSource = treeSource;
}
示例15: CreateRecoverableTree
public override SyntaxTree CreateRecoverableTree(string filePath, ParseOptions options, ValueSource<TextAndVersion> text, SyntaxNode root, bool reparse)
{
options = options ?? GetDefaultParseOptions();
if (reparse)
{
return new ReparsedSyntaxTree(this, filePath, (CSharpParseOptions)options, text, (CompilationUnitSyntax)root);
}
else
{
return new SerializedSyntaxTree(this, filePath, (CSharpParseOptions)options, text, (CompilationUnitSyntax)root);
}
}