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


C# CodeAnalysis.SolutionServices类代码示例

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


SolutionServices类属于Microsoft.CodeAnalysis命名空间,在下文中一共展示了SolutionServices类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateRecoverableText

 protected static ValueSource<TextAndVersion> CreateRecoverableText(TextLoader loader, DocumentId documentId, SolutionServices services)
 {
     return new RecoverableTextAndVersion(
         new AsyncLazy<TextAndVersion>(c => LoadTextAsync(loader, documentId, services, c), cacheResult: false),
         services.TemporaryStorage,
         services.TextCache);
 }
开发者ID:jerriclynsjohn,项目名称:roslyn,代码行数:7,代码来源:TextDocumentState.cs

示例2: SolutionState

        private SolutionState(
            BranchId branchId,
            int workspaceVersion,
            SolutionServices solutionServices,
            SolutionId id,
            string filePath,
            IEnumerable<ProjectId> projectIds,
            ImmutableDictionary<ProjectId, ProjectState> idToProjectStateMap,
            ImmutableDictionary<ProjectId, CompilationTracker> projectIdToTrackerMap,
            ImmutableDictionary<string, ImmutableArray<DocumentId>> linkedFilesMap,
            ProjectDependencyGraph dependencyGraph,
            VersionStamp version,
            Lazy<VersionStamp> lazyLatestProjectVersion)
        {
            _branchId = branchId;
            _workspaceVersion = workspaceVersion;
            _id = id;
            _filePath = filePath;
            _solutionServices = solutionServices;
            _projectIds = projectIds.ToImmutableReadOnlyListOrEmpty();
            _projectIdToProjectStateMap = idToProjectStateMap;
            _projectIdToTrackerMap = projectIdToTrackerMap;
            _linkedFilesMap = linkedFilesMap;
            _dependencyGraph = dependencyGraph;
            _version = version;
            _lazyLatestProjectVersion = lazyLatestProjectVersion;

            CheckInvariants();
        }
开发者ID:tvsonar,项目名称:roslyn,代码行数:29,代码来源:SolutionState.cs

示例3: SolutionState

        private SolutionState(
            BranchId branchId,
            int workspaceVersion,
            SolutionServices solutionServices,
            SolutionInfo solutionInfo,
            IEnumerable<ProjectId> projectIds,
            ImmutableDictionary<ProjectId, ProjectState> idToProjectStateMap,
            ImmutableDictionary<ProjectId, CompilationTracker> projectIdToTrackerMap,
            ImmutableDictionary<string, ImmutableArray<DocumentId>> linkedFilesMap,
            ProjectDependencyGraph dependencyGraph,
            Lazy<VersionStamp> lazyLatestProjectVersion)
        {
            _branchId = branchId;
            _workspaceVersion = workspaceVersion;
            _solutionServices = solutionServices;
            _solutionInfo = solutionInfo;
            _projectIds = projectIds.ToImmutableReadOnlyListOrEmpty();
            _projectIdToProjectStateMap = idToProjectStateMap;
            _projectIdToTrackerMap = projectIdToTrackerMap;
            _linkedFilesMap = linkedFilesMap;
            _dependencyGraph = dependencyGraph;
            _lazyLatestProjectVersion = lazyLatestProjectVersion;

            // when solution state is changed, we re-calcuate its checksum
            _lazyChecksums = new AsyncLazy<SolutionStateChecksums>(ComputeChecksumsAsync, cacheResult: true);

            CheckInvariants();
        }
开发者ID:TyOverby,项目名称:roslyn,代码行数:28,代码来源:SolutionState.cs

示例4: Solution

        private Solution(
            BranchId branchId,
            int workspaceVersion,
            SolutionServices solutionServices,
            SolutionId id,
            string filePath,
            ImmutableList<ProjectId> projectIds,
            ImmutableDictionary<ProjectId, ProjectState> idToProjectStateMap,
            ImmutableDictionary<ProjectId, CompilationTracker> projectIdToTrackerMap,
            ProjectDependencyGraph dependencyGraph,
            VersionStamp version,
            Lazy<VersionStamp> lazyLatestProjectVersion)
        {
            this.branchId = branchId;
            this.workspaceVersion = workspaceVersion;
            this.id = id;
            this.filePath = filePath;
            this.solutionServices = solutionServices;
            this.projectIds = projectIds;
            this.projectIdToProjectStateMap = idToProjectStateMap;
            this.projectIdToTrackerMap = projectIdToTrackerMap;
            this.dependencyGraph = dependencyGraph;
            this.projectIdToProjectMap = ImmutableHashMap<ProjectId, Project>.Empty;
            this.version = version;
            this.lazyLatestProjectVersion = lazyLatestProjectVersion;

            CheckInvariants();
        }
开发者ID:riversky,项目名称:roslyn,代码行数:28,代码来源:Solution.cs

示例5: ProjectState

        public ProjectState(ProjectInfo projectInfo, HostLanguageServices languageServices, SolutionServices solutionServices)
        {
            Contract.ThrowIfNull(projectInfo);
            Contract.ThrowIfNull(languageServices);
            Contract.ThrowIfNull(solutionServices);

            _languageServices = languageServices;
            _solutionServices = solutionServices;

            _projectInfo = FixProjectInfo(projectInfo);

            _documentIds = _projectInfo.Documents.Select(d => d.Id).ToImmutableArray();
            _additionalDocumentIds = _projectInfo.AdditionalDocuments.Select(d => d.Id).ToImmutableArray();

            var docStates = ImmutableDictionary.CreateRange<DocumentId, DocumentState>(
                _projectInfo.Documents.Select(d =>
                    new KeyValuePair<DocumentId, DocumentState>(d.Id,
                        CreateDocument(_projectInfo, d, languageServices, solutionServices))));

            _documentStates = docStates;

            var additionalDocStates = ImmutableDictionary.CreateRange<DocumentId, TextDocumentState>(
                    _projectInfo.AdditionalDocuments.Select(d =>
                        new KeyValuePair<DocumentId, TextDocumentState>(d.Id, TextDocumentState.Create(d, solutionServices))));

            _additionalDocumentStates = additionalDocStates;

            _lazyLatestDocumentVersion = new AsyncLazy<VersionStamp>(c => ComputeLatestDocumentVersionAsync(docStates, additionalDocStates, c), cacheResult: true);
            _lazyLatestDocumentTopLevelChangeVersion = new AsyncLazy<VersionStamp>(c => ComputeLatestDocumentTopLevelChangeVersionAsync(docStates, additionalDocStates, c), cacheResult: true);

            // 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,代码行数:34,代码来源:ProjectState.cs

示例6: Create

        public static DocumentState Create(
            DocumentInfo info,
            ParseOptions options,
            HostLanguageServices language,
            SolutionServices services)
        {
            var textSource = info.TextLoader != null
                ? CreateRecoverableText(info.TextLoader, info.Id, services)
                : CreateStrongText(TextAndVersion.Create(SourceText.From(string.Empty, Encoding.UTF8), VersionStamp.Default, info.FilePath));

            var treeSource = CreateLazyFullyParsedTree(
                textSource,
                GetSyntaxTreeFilePath(info),
                options,
                languageServices: language);

            // remove any initial loader so we don't keep source alive
            info = info.WithTextLoader(null);

            return new DocumentState(
                languageServices: language,
                solutionServices: services,
                info: info,
                options: options,
                textSource: textSource,
                treeSource: treeSource);
        }
开发者ID:EkardNT,项目名称:Roslyn,代码行数:27,代码来源:DocumentState.cs

示例7: ProjectState

        internal ProjectState(ProjectInfo projectInfo, HostLanguageServices languageServices, SolutionServices solutionServices)
        {
            Contract.ThrowIfNull(projectInfo);
            Contract.ThrowIfNull(languageServices);
            Contract.ThrowIfNull(solutionServices);

            _languageServices = languageServices;
            _solutionServices = solutionServices;

            _projectInfo = FixProjectInfo(projectInfo);

            _documentIds = _projectInfo.Documents.Select(d => d.Id).ToImmutableArray();
            _additionalDocumentIds = this.ProjectInfo.AdditionalDocuments.Select(d => d.Id).ToImmutableArray();

            var docStates = ImmutableDictionary.CreateRange<DocumentId, DocumentState>(
                _projectInfo.Documents.Select(d =>
                    new KeyValuePair<DocumentId, DocumentState>(d.Id,
                        CreateDocument(this.ProjectInfo, d, languageServices, solutionServices))));

            _documentStates = docStates;

            var additionalDocStates = ImmutableDictionary.CreateRange<DocumentId, TextDocumentState>(
                    _projectInfo.AdditionalDocuments.Select(d =>
                        new KeyValuePair<DocumentId, TextDocumentState>(d.Id, TextDocumentState.Create(d, solutionServices))));

            _additionalDocumentStates = additionalDocStates;

            _lazyLatestDocumentVersion = new AsyncLazy<VersionStamp>(c => ComputeLatestDocumentVersionAsync(docStates, additionalDocStates, c), cacheResult: true);
            _lazyLatestDocumentTopLevelChangeVersion = new AsyncLazy<VersionStamp>(c => ComputeLatestDocumentTopLevelChangeVersionAsync(docStates, additionalDocStates, c), cacheResult: true);
        }
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:30,代码来源:ProjectState.cs

示例8: CreateValueSource

 public static ValueSource<Compilation> CreateValueSource(
     Compilation compilation,
     SolutionServices services)
 {
     return services.SupportsCachingRecoverableObjects
         ? new WeakConstantValueSource<Compilation>(compilation)
         : (ValueSource<Compilation>)new ConstantValueSource<Compilation>(compilation);
 }
开发者ID:Rickinio,项目名称:roslyn,代码行数:8,代码来源:Solution.CompilationTracker.State.cs

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

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

示例11: CreateLazyFullyParsedTree

 private static ValueSource<TreeAndVersion> CreateLazyFullyParsedTree(
     ValueSource<TextAndVersion> newTextSource,
     ProjectId cacheKey,
     string filePath,
     ParseOptions options,
     HostLanguageServices languageServices,
     SolutionServices solutionServices,
     PreservationMode mode = PreservationMode.PreserveValue)
 {
     return new AsyncLazy<TreeAndVersion>(
         c => FullyParseTreeAsync(newTextSource, cacheKey, filePath, options, languageServices, solutionServices, mode, c),
         cacheResult: true);
 }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:13,代码来源:DocumentState.cs

示例12: Create

        public static TextDocumentState Create(DocumentInfo info, SolutionServices services)
        {
            var textSource = info.TextLoader != null
                ? CreateRecoverableText(info.TextLoader, info.Id, services, reportInvalidDataException: false)
                : CreateStrongText(TextAndVersion.Create(SourceText.From(string.Empty, Encoding.UTF8), VersionStamp.Default, info.FilePath));

            // remove any initial loader so we don't keep source alive
            info = info.WithTextLoader(null);

            return new TextDocumentState(
                solutionServices: services,
                info: info,
                textSource: textSource);
        }
开发者ID:daking2014,项目名称:roslyn,代码行数:14,代码来源:TextDocumentState.cs

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

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

示例15: ProjectState

 private ProjectState(
     ProjectInfo projectInfo,
     ILanguageServiceProvider languageServices,
     SolutionServices solutionServices,
     ImmutableList<DocumentId> documentIds,
     ImmutableDictionary<DocumentId, DocumentState> documentStates,
     AsyncLazy<VersionStamp> lazyLatestDocumentVersion,
     AsyncLazy<VersionStamp> lazyLatestDocumentTopLevelChangeVersion)
 {
     this.projectInfo = projectInfo;
     this.solutionServices = solutionServices;
     this.languageServices = languageServices;
     this.documentIds = documentIds;
     this.documentStates = documentStates;
     this.lazyLatestDocumentVersion = lazyLatestDocumentVersion;
     this.lazyLatestDocumentTopLevelChangeVersion = lazyLatestDocumentTopLevelChangeVersion;
 }
开发者ID:riversky,项目名称:roslyn,代码行数:17,代码来源:ProjectState.cs


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