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


C# IEnumerable.ToImmutableReadOnlyListOrEmpty方法代码示例

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


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

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

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

示例3: DocumentInfo

        /// <summary>
        /// Create a new instance of a <see cref="DocumentInfo"/>.
        /// </summary>
        private DocumentInfo(
            DocumentId id,
            string name,
            IEnumerable<string> folders,
            SourceCodeKind sourceCodeKind,
            TextLoader loader,
            string filePath,
            bool isGenerated)
        {
            if (id == null)
            {
                throw new ArgumentNullException(nameof(id));
            }

            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }

            this.Id = id;
            this.Name = name;
            this.Folders = folders.ToImmutableReadOnlyListOrEmpty();
            this.SourceCodeKind = sourceCodeKind;
            this.TextLoader = loader;
            this.FilePath = filePath;
            this.IsGenerated = isGenerated;
        }
开发者ID:Rickinio,项目名称:roslyn,代码行数:30,代码来源:DocumentInfo.cs

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

示例5: SolutionInfo

 private SolutionInfo(
     SolutionId id,
     VersionStamp version,
     string filePath,
     IEnumerable<ProjectInfo> projects)
 {
     this.Id = id;
     this.Version = version;
     this.FilePath = filePath;
     this.Projects = projects.ToImmutableReadOnlyListOrEmpty();
 }
开发者ID:Rickinio,项目名称:roslyn,代码行数:11,代码来源:SolutionInfo.cs

示例6: ProjectFileInfo

 public ProjectFileInfo(
     string outputPath,
     string assemblyName,
     IEnumerable<string> commandLineArgs,
     IEnumerable<DocumentFileInfo> documents,
     IEnumerable<DocumentFileInfo> additionalDocuments,
     IEnumerable<ProjectFileReference> projectReferences)
 {
     this.OutputFilePath = outputPath;
     this.AssemblyName = assemblyName;
     this.CommandLineArgs = commandLineArgs.ToImmutableArrayOrEmpty();
     this.Documents = documents.ToImmutableReadOnlyListOrEmpty();
     this.AdditionalDocuments = additionalDocuments.ToImmutableArrayOrEmpty();
     this.ProjectReferences = projectReferences.ToImmutableReadOnlyListOrEmpty();
 }
开发者ID:Rickinio,项目名称:roslyn,代码行数:15,代码来源:ProjectFileInfo.cs

示例7: ProjectState

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

示例8: ProjectFileInfo

 public ProjectFileInfo(
     Guid guid,
     string outputPath,
     string assemblyName,
     CompilationOptions compilationOptions,
     ParseOptions parseOptions,
     IEnumerable<DocumentFileInfo> documents,
     IEnumerable<ProjectFileReference> projectReferences,
     IEnumerable<MetadataReference> metadataReferences,
     IEnumerable<AnalyzerReference> analyzerReferences)
 {
     this.Guid = guid;
     this.OutputFilePath = outputPath;
     this.AssemblyName = assemblyName;
     this.CompilationOptions = compilationOptions;
     this.ParseOptions = parseOptions;
     this.Documents = documents.ToImmutableReadOnlyListOrEmpty();
     this.ProjectReferences = projectReferences.ToImmutableReadOnlyListOrEmpty();
     this.MetadataReferences = metadataReferences.ToImmutableReadOnlyListOrEmpty();
     this.AnalyzerReferences = analyzerReferences.ToImmutableReadOnlyListOrEmpty();
 }
开发者ID:EkardNT,项目名称:Roslyn,代码行数:21,代码来源:ProjectFileInfo.cs

示例9: 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)
        {
            _projectInfo = projectInfo;
            _solutionServices = solutionServices;
            _languageServices = languageServices;
            _documentIds = documentIds.ToImmutableReadOnlyListOrEmpty();
            _additionalDocumentIds = additionalDocumentIds.ToImmutableReadOnlyListOrEmpty();
            _documentStates = documentStates;
            _additionalDocumentStates = additionalDocumentStates;
            _lazyLatestDocumentVersion = lazyLatestDocumentVersion;
            _lazyLatestDocumentTopLevelChangeVersion = lazyLatestDocumentTopLevelChangeVersion;

            _lazyChecksums = new AsyncLazy<ProjectStateChecksums>(ComputeChecksumsAsync, cacheResult: true);
        }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:23,代码来源:ProjectState.cs

示例10: WithAnalyzerReferences

 public ProjectInfo WithAnalyzerReferences(IEnumerable<AnalyzerReference> analyzerReferences)
 {
     return With(analyzerReferences: analyzerReferences.ToImmutableReadOnlyListOrEmpty());
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:4,代码来源:ProjectInfo.cs

示例11: WithAdditionalDocuments

 public ProjectInfo WithAdditionalDocuments(IEnumerable<DocumentInfo> additionalDocuments)
 {
     return With(additionalDocuments: additionalDocuments.ToImmutableReadOnlyListOrEmpty());
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:4,代码来源:ProjectInfo.cs

示例12: ProjectInfo

        private ProjectInfo(
            ProjectId id,
            VersionStamp version,
            string name,
            string assemblyName,
            string language,
            string filePath,
            string outputFilePath,
            CompilationOptions compilationOptions,
            ParseOptions parseOptions,
            IEnumerable<DocumentInfo> documents,
            IEnumerable<ProjectReference> projectReferences,
            IEnumerable<MetadataReference> metadataReferences,
            IEnumerable<AnalyzerReference> analyzerReferences,
            bool isSubmission,
            Type hostObjectType)
        {
            if (id == null)
            {
                throw new ArgumentNullException("id");
            }

            if (name == null)
            {
                throw new ArgumentNullException("displayName");
            }

            if (assemblyName == null)
            {
                throw new ArgumentNullException("assemblyName");
            }

            if (language == null)
            {
                throw new ArgumentNullException("language");
            }

            this.Id = id;
            this.Version = version;
            this.Name = name;
            this.AssemblyName = assemblyName;
            this.Language = language;
            this.FilePath = filePath;
            this.OutputFilePath = outputFilePath;
            this.CompilationOptions = compilationOptions;
            this.ParseOptions = parseOptions;
            this.Documents = documents.ToImmutableReadOnlyListOrEmpty();
            this.ProjectReferences = projectReferences.ToImmutableReadOnlyListOrEmpty();
            this.MetadataReferences = metadataReferences.ToImmutableReadOnlyListOrEmpty();
            this.AnalyzerReferences = analyzerReferences.ToImmutableReadOnlyListOrEmpty();
            this.IsSubmission = isSubmission;
            this.HostObjectType = hostObjectType;
        }
开发者ID:pheede,项目名称:roslyn,代码行数:53,代码来源:ProjectInfo.cs

示例13: WithProjectReferences

 public ProjectInfo WithProjectReferences(IEnumerable<ProjectReference> projectReferences)
 {
     return With(projectReferences: projectReferences.ToImmutableReadOnlyListOrEmpty());
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:4,代码来源:ProjectInfo.cs

示例14: SolutionInfo

 private SolutionInfo(SolutionAttributes attributes, IEnumerable<ProjectInfo> projects)
 {
     Attributes = attributes;
     Projects = projects.ToImmutableReadOnlyListOrEmpty();
 }
开发者ID:otawfik-ms,项目名称:roslyn,代码行数:5,代码来源:SolutionInfo.cs

示例15: WithDocuments

 public ProjectInfo WithDocuments(IEnumerable<DocumentInfo> documents)
 {
     return With(documents: documents.ToImmutableReadOnlyListOrEmpty());
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:4,代码来源:ProjectInfo.cs


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