• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ValueSource类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ValueSource的典型用法代码示例。如果您正苦于以下问题:C# ValueSource类的具体用法?C# ValueSource怎么用?C# ValueSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ValueSource类属于命名空间,在下文中一共展示了ValueSource类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: Create

                public static State Create(
                    ValueSource<Compilation> compilationSource,
                    ImmutableArray<ValueTuple<ProjectState, CompilationTranslationAction>> intermediateProjects)
                {
                    Contract.ThrowIfNull(compilationSource);
                    Contract.ThrowIfNull(compilationSource.GetValue());
                    Contract.ThrowIfTrue(intermediateProjects.IsDefault);

                    // If we don't have any intermediate projects to process, just initialize our
                    // DeclarationState now.
                    return intermediateProjects.Length == 0
                        ? (State)new FullDeclarationState(compilationSource)
                        : (State)new InProgressState(compilationSource, intermediateProjects);
                }
开发者ID:modulexcite,项目名称:pattern-matching-csharp,代码行数:14,代码来源:Solution.CompilationTracker.State.cs


示例17: DocumentState

 private DocumentState(
     HostLanguageServices languageServices,
     SolutionServices solutionServices,
     DocumentInfo info,
     ParseOptions options,
     ValueSource<TextAndVersion> textSource,
     ValueSource<TreeAndVersion> treeSource)
 {
     this.languageServices = languageServices;
     this.solutionServices = solutionServices;
     this.info = info;
     this.options = options;
     this.textSource = textSource;
     this.treeSource = treeSource;
 }
开发者ID:EkardNT,项目名称:Roslyn,代码行数:15,代码来源:DocumentState.cs


示例18: ExpressionFunctionValues

 internal ExpressionFunctionValues(ValueSource parent, Expression expression, FunctionValues
     [] functionValues)
     : base(parent)
 {
     if (expression == null)
     {
         throw new ArgumentNullException();
     }
     if (functionValues == null)
     {
         throw new ArgumentNullException();
     }
     this.expression = expression;
     this.functionValues = functionValues;
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:15,代码来源:ExpressionFunctionValues.cs


示例19: TextDocumentState

        protected TextDocumentState(
            SolutionServices solutionServices,
            DocumentInfo info,
            SourceText sourceTextOpt,
            ValueSource<TextAndVersion> textAndVersionSource,
            ValueSource<DocumentStateChecksums> lazyChecksums)
        {
            this.solutionServices = solutionServices;
            this.info = info;
            this.sourceTextOpt = sourceTextOpt;
            this.textAndVersionSource = textAndVersionSource;

            // 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<DocumentStateChecksums>(ComputeChecksumsAsync, cacheResult: true);
        }
开发者ID:TyOverby,项目名称:roslyn,代码行数:16,代码来源:TextDocumentState.cs


示例20: TryGetOrAddMetadata

            public bool TryGetOrAddMetadata(FileKey key, ValueSource<AssemblyMetadata> newMetadata, out AssemblyMetadata metadata)
            {
                lock (_gate)
                {
                    if (TryGetMetadata_NoLock(key, out metadata))
                    {
                        return false;
                    }

                    EnsureCapacity_NoLock();

                    metadata = newMetadata.GetValue();
                    Contract.ThrowIfNull(metadata);

                    // don't use "Add" since key might already exist with already released metadata
                    _metadataCache[key] = newMetadata;
                    return true;
                }
            }
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:19,代码来源:VisualStudioMetadataReferenceManager.MetadataCache.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ValueType类代码示例发布时间:2022-05-24
下一篇:
C# ValueSet类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap