本文整理汇总了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();
}
示例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();
}
示例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;
}
示例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);
}
示例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();
}
示例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();
}
示例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;
}
示例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();
}
示例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);
}
示例10: WithAnalyzerReferences
public ProjectInfo WithAnalyzerReferences(IEnumerable<AnalyzerReference> analyzerReferences)
{
return With(analyzerReferences: analyzerReferences.ToImmutableReadOnlyListOrEmpty());
}
示例11: WithAdditionalDocuments
public ProjectInfo WithAdditionalDocuments(IEnumerable<DocumentInfo> additionalDocuments)
{
return With(additionalDocuments: additionalDocuments.ToImmutableReadOnlyListOrEmpty());
}
示例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;
}
示例13: WithProjectReferences
public ProjectInfo WithProjectReferences(IEnumerable<ProjectReference> projectReferences)
{
return With(projectReferences: projectReferences.ToImmutableReadOnlyListOrEmpty());
}
示例14: SolutionInfo
private SolutionInfo(SolutionAttributes attributes, IEnumerable<ProjectInfo> projects)
{
Attributes = attributes;
Projects = projects.ToImmutableReadOnlyListOrEmpty();
}
示例15: WithDocuments
public ProjectInfo WithDocuments(IEnumerable<DocumentInfo> documents)
{
return With(documents: documents.ToImmutableReadOnlyListOrEmpty());
}