예제 #1
0
 private void AddVirtualDocuments(RazorCodeDocument document, string relativePath)
 {
     foreach (var item in _project.EnumerateAscending(relativePath, ".razor"))
     {
         if (item.Filename == "_PageImports.razor")
         {
             var source = item.ToSourceDocument();
             var parsed = RazorParser.Parse(source);
             document.AddVirtualSyntaxTree(parsed);
         }
     }
 }
예제 #2
0
        private void SetImportedDocuments(RazorCodeDocument document, string relativePath)
        {
            var importedDocuments = new List <RazorSourceDocument>();

            foreach (var item in _project.EnumerateAscending(relativePath, ".razor"))
            {
                if (item.Filename == "_PageImports.razor")
                {
                    var sourceDocument = item.ToSourceDocument();
                    importedDocuments.Add(sourceDocument);
                }
            }

            document.SetImportedDocuments(importedDocuments);
        }