Ejemplo n.º 1
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,
                documents.AsBoxedImmutableArrayWithNonNullItems() ?? throw new ArgumentNullException(nameof(documents)),
                projectReferences.AsBoxedImmutableArrayWithNonNullItems() ?? throw new ArgumentNullException(nameof(projectReferences)),
                metadataReferences.AsBoxedImmutableArrayWithNonNullItems() ?? throw new ArgumentNullException(nameof(metadataReferences)),
                analyzerReferences.AsBoxedImmutableArrayWithNonNullItems() ?? throw new ArgumentNullException(nameof(analyzerReferences)),
                additionalDocuments.AsBoxedImmutableArrayWithNonNullItems() ?? throw new ArgumentNullException(nameof(additionalDocuments)),
                analyzerConfigDocuments: SpecializedCollections.EmptyBoxedImmutableArray <DocumentInfo>(),
                hostObjectType));
 }