当前位置: 首页>>代码示例>>C#>>正文


C# ValueSource类代码示例

本文整理汇总了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);
 }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:12,代码来源:TaxonomyFacetSumValueSource.cs

示例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;
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:10,代码来源:ReciprocalFloatFunction.cs

示例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);
        }
开发者ID:GuilhermeSa,项目名称:roslyn,代码行数:26,代码来源:ProjectState.cs

示例4: TryGetSource

 public bool TryGetSource(FileKey key, out ValueSource<AssemblyMetadata> source)
 {
     lock (_gate)
     {
         return _metadataCache.TryGetValue(key, out source);
     }
 }
开发者ID:GuilhermeSa,项目名称:roslyn,代码行数:7,代码来源:VisualStudioMetadataReferenceManager.MetadataCache.cs

示例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());
                }
开发者ID:Rickinio,项目名称:roslyn,代码行数:8,代码来源:Solution.CompilationTracker.State.cs

示例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;
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:8,代码来源:RangeMapFloatFunction.cs

示例7: TextDocumentState

 protected TextDocumentState(
     SolutionServices solutionServices,
     DocumentInfo info,
     ValueSource<TextAndVersion> textSource)
 {
     this.solutionServices = solutionServices;
     this.info = info;
     this.textSource = textSource;
 }
开发者ID:daking2014,项目名称:roslyn,代码行数:9,代码来源:TextDocumentState.cs

示例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);
        }
开发者ID:apache,项目名称:lucenenet,代码行数:12,代码来源:DistanceToShapeValueSource.cs

示例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);
 }
开发者ID:jerriclynsjohn,项目名称:roslyn,代码行数:11,代码来源:DocumentState.cs

示例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;
                }
开发者ID:riversky,项目名称:roslyn,代码行数:12,代码来源:Solution.CompilationTracker.State.cs

示例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;
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:12,代码来源:DocTermsIndexDocValues.cs

示例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);
        }
开发者ID:cothienlac86,项目名称:fubumvc,代码行数:12,代码来源:ValueSourceTester.cs

示例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;
                }
开发者ID:modulexcite,项目名称:pattern-matching-csharp,代码行数:12,代码来源:Solution.CompilationTracker.State.cs

示例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;
 }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:13,代码来源:DocumentState.cs

示例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);
                }
            }
开发者ID:riversky,项目名称:roslyn,代码行数:13,代码来源:CSharpSyntaxTreeFactoryService.cs


注:本文中的ValueSource类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。