Ejemplo n.º 1
0
 public static SolutionInfo Create(
     SolutionId id,
     VersionStamp version,
     string?filePath = null,
     IEnumerable <ProjectInfo>?projects = null)
 {
     return(new SolutionInfo(
                new SolutionAttributes(
                    id ?? throw new ArgumentNullException(nameof(id)),
                    version,
                    filePath),
                PublicContract.ToBoxedImmutableArrayWithDistinctNonNullItems(projects, nameof(projects))));
 }
Ejemplo n.º 2
0
 public static ProjectInfo Create(
     ProjectId id,
     VersionStamp version,
     string name,
     string assemblyName,
     string language,
     string?filePath       = null,
     string?outputFilePath = null,
     CompilationOptions?compilationOptions              = null,
     ParseOptions?parseOptions                          = null,
     IEnumerable <DocumentInfo>?documents               = null,
     IEnumerable <ProjectReference>?projectReferences   = null,
     IEnumerable <MetadataReference>?metadataReferences = null,
     IEnumerable <AnalyzerReference>?analyzerReferences = null,
     IEnumerable <DocumentInfo>?additionalDocuments     = null,
     bool isSubmission        = false,
     Type?hostObjectType      = null,
     string?outputRefFilePath = null)
 {
     return(new ProjectInfo(
                new ProjectAttributes(
                    id ?? throw new ArgumentNullException(nameof(id)),
                    version,
                    name ?? throw new ArgumentNullException(nameof(name)),
                    assemblyName ?? throw new ArgumentNullException(nameof(assemblyName)),
                    language ?? throw new ArgumentNullException(nameof(language)),
                    filePath,
                    outputFilePath,
                    outputRefFilePath,
                    defaultNamespace: null,
                    isSubmission,
                    hasAllInformation: true,
                    runAnalyzers: true),
                compilationOptions,
                parseOptions,
                PublicContract.ToBoxedImmutableArrayWithDistinctNonNullItems(documents, nameof(documents)),
                PublicContract.ToBoxedImmutableArrayWithDistinctNonNullItems(projectReferences, nameof(projectReferences)),
                PublicContract.ToBoxedImmutableArrayWithDistinctNonNullItems(metadataReferences, nameof(metadataReferences)),
                PublicContract.ToBoxedImmutableArrayWithDistinctNonNullItems(analyzerReferences, nameof(analyzerReferences)),
                PublicContract.ToBoxedImmutableArrayWithDistinctNonNullItems(additionalDocuments, nameof(additionalDocuments)),
                analyzerConfigDocuments: SpecializedCollections.EmptyBoxedImmutableArray <DocumentInfo>(),
                hostObjectType));
 }