示例#1
0
 internal static DocumentInfo Create(
     DocumentId id,
     string name,
     IReadOnlyList <string> folders,
     SourceCodeKind sourceCodeKind,
     TextLoader?loader,
     string?filePath,
     bool isGenerated,
     bool designTimeOnly,
     IDocumentServiceProvider?documentServiceProvider
     )
 {
     return(new DocumentInfo(
                new DocumentAttributes(
                    id,
                    name,
                    folders,
                    sourceCodeKind,
                    filePath,
                    isGenerated,
                    designTimeOnly: designTimeOnly
                    ),
                loader,
                documentServiceProvider
                ));
 }
示例#2
0
 /// <summary>
 /// Create a new instance of a <see cref="DocumentInfo"/>.
 /// </summary>
 internal DocumentInfo(
     DocumentAttributes attributes,
     TextLoader?loader,
     IDocumentServiceProvider?documentServiceProvider
     )
 {
     Attributes = attributes;
     TextLoader = loader;
     DocumentServiceProvider = documentServiceProvider;
 }
示例#3
0
 public static DocumentInfo Create(
     DocumentId id,
     string name,
     IEnumerable <string>?folders  = null,
     SourceCodeKind sourceCodeKind = SourceCodeKind.Regular,
     TextLoader?loader             = null,
     string?filePath  = null,
     bool isGenerated = false)
 {
     return(Create(id, name, folders, sourceCodeKind, loader, filePath, isGenerated, documentServiceProvider: null));
 }
示例#4
0
 internal static DocumentInfo Create(
     DocumentId id,
     string name,
     IEnumerable <string>?folders,
     SourceCodeKind sourceCodeKind,
     TextLoader?loader,
     string?filePath,
     bool isGenerated,
     IDocumentServiceProvider?documentServiceProvider)
 {
     return(new DocumentInfo(new DocumentAttributes(id, name, folders.ToBoxedImmutableArray(), sourceCodeKind, filePath, isGenerated), loader, documentServiceProvider));
 }
示例#5
0
 public static DocumentInfo Create(
     DocumentId id,
     string name,
     IEnumerable <string>?folders,
     SourceCodeKind sourceCodeKind,
     TextLoader?loader,
     string?filePath,
     bool isGenerated,
     RazorDocumentServiceProviderWrapper documentServiceProvider)
 {
     return(DocumentInfo.Create(id, name, folders.ToBoxedImmutableArray(), sourceCodeKind, loader, filePath, isGenerated, documentServiceProvider));
 }
示例#6
0
 public static DocumentInfo Create(
     DocumentId id,
     string name,
     IEnumerable <string>?folders  = null,
     SourceCodeKind sourceCodeKind = SourceCodeKind.Regular,
     TextLoader?loader             = null,
     string?filePath  = null,
     bool isGenerated = false)
 {
     return(Create(
                id ?? throw new ArgumentNullException(nameof(id)),
                name ?? throw new ArgumentNullException(nameof(name)),
                folders.AsBoxedImmutableArrayWithNonNullItems() ?? throw new ArgumentNullException(nameof(folders)),
                sourceCodeKind,
                loader,
                filePath,
                isGenerated,
                documentServiceProvider: null));
 }
        public DocumentInfo CreateDocumentInfo(
            DocumentId id,
            string name,
            IReadOnlyList <string>?folders = null,
            SourceCodeKind sourceCodeKind  = SourceCodeKind.Regular,
            TextLoader?loader   = null,
            string?filePath     = null,
            bool isGenerated    = false,
            bool designTimeOnly = false,
            IRazorDocumentServiceProvider?razorDocumentServiceProvider = null)
        {
            folders ??= new List <string>();

            IDocumentServiceProvider?documentServiceProvider = null;

            if (razorDocumentServiceProvider is not null)
            {
                documentServiceProvider = new RazorDocumentServiceProviderWrapper(razorDocumentServiceProvider);
            }

            return(DocumentInfo.Create(id, name, folders, sourceCodeKind, loader, filePath, isGenerated, designTimeOnly, documentServiceProvider));
        }
示例#8
0
 public DocumentInfo WithTextLoader(TextLoader?loader)
 {
     return(With(loader: loader));
 }