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


C# ValueSource.GetValue方法代码示例

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


在下文中一共展示了ValueSource.GetValue方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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

示例2: 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

示例3: GetTextAndVersion

 private static TextAndVersion GetTextAndVersion(
     ValueSource<TreeAndVersion> newTreeSource, VersionStamp version, Encoding encoding, string filePath, CancellationToken cancellationToken)
 {
     var treeAndVersion = newTreeSource.GetValue(cancellationToken);
     var text = treeAndVersion.Tree.GetRoot(cancellationToken).GetText(encoding);
     return TextAndVersion.Create(text, version, filePath);
 }
开发者ID:EkardNT,项目名称:Roslyn,代码行数:7,代码来源:DocumentState.cs

示例4: FinalState

 public FinalState(ValueSource<Compilation> finalCompilationSource, bool hasSuccessfullyLoadedTransitively)
     : base(finalCompilationSource, finalCompilationSource.GetValue().Clone().RemoveAllReferences())
 {
     _hasSuccessfullyLoadedTransitively = hasSuccessfullyLoadedTransitively;
 }
开发者ID:Rickinio,项目名称:roslyn,代码行数:5,代码来源:Solution.CompilationTracker.State.cs

示例5: FinalState

 public FinalState(ValueSource<Compilation> finalCompilationSource)
     : base(finalCompilationSource, finalCompilationSource.GetValue().Clone().RemoveAllReferences())
 {
 }
开发者ID:GloryChou,项目名称:roslyn,代码行数:4,代码来源:Solution.CompilationTracker.State.cs

示例6: 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

示例7: FullDeclarationState

 public FullDeclarationState(ValueSource<Compilation> declarationCompilation)
     : base(declarationCompilation, declarationCompilation.GetValue().RemoveAllReferences())
 {
 }
开发者ID:modulexcite,项目名称:pattern-matching-csharp,代码行数:4,代码来源:Solution.CompilationTracker.State.cs

示例8: IncrementallyParseTree

        private static TreeAndVersion IncrementallyParseTree(
            ValueSource<TreeAndVersion> oldTreeSource,
            ValueSource<TextAndVersion> newTextSource,
            CancellationToken cancellationToken)
        {
            try
            {
                using (Logger.LogBlock(FunctionId.Workspace_Document_State_IncrementallyParseSyntaxTree, cancellationToken))
                {
                    var newTextAndVersion = newTextSource.GetValue(cancellationToken);
                    var oldTreeAndVersion = oldTreeSource.GetValue(cancellationToken);

                    return IncrementallyParse(newTextAndVersion, oldTreeAndVersion, cancellationToken);
                }
            }
            catch (Exception e) when (FatalError.ReportUnlessCanceled(e))
            {
                throw ExceptionUtilities.Unreachable;
            }
        }
开发者ID:jkotas,项目名称:roslyn,代码行数:20,代码来源:DocumentState.cs

示例9: FullyParseTree

 private static TreeAndVersion FullyParseTree(
     ValueSource<TextAndVersion> newTextSource,
     ProjectId cacheKey,
     string filePath,
     ParseOptions options,
     HostLanguageServices languageServices,
     SolutionServices solutionServices,
     PreservationMode mode,
     CancellationToken cancellationToken)
 {
     using (Logger.LogBlock(FunctionId.Workspace_Document_State_FullyParseSyntaxTree, s_fullParseLog, filePath, mode, cancellationToken))
     {
         var textAndVersion = newTextSource.GetValue(cancellationToken);
         return CreateTreeAndVersion(newTextSource, cacheKey, filePath, options, languageServices, mode, textAndVersion, cancellationToken);
     }
 }
开发者ID:jkotas,项目名称:roslyn,代码行数:16,代码来源:DocumentState.cs

示例10: FinalState

 public FinalState(ValueSource<Compilation> finalCompilationSource, bool hasCompleteReferences)
     : base(finalCompilationSource, finalCompilationSource.GetValue().Clone().RemoveAllReferences())
 {
     _hasCompleteReferences = hasCompleteReferences;
 }
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:5,代码来源:Solution.CompilationTracker.State.cs

示例11: 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


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