Esempio n. 1
0
        private void LoadInternal(string viewPath)
        {
            if (string.IsNullOrEmpty(viewPath))
            {
                return;
            }

            var newEntry = this.BindEntry(viewPath);

            var context = new VisitorContext
            {
                ViewFolder       = this.ViewFolder,
                Prefix           = this.Prefix,
                ExtensionFactory = this.ExtensionFactory,
                PartialFileNames = this.FindPartialFiles(viewPath),
                Bindings         = this.FindBindings()
            };

            newEntry.Chunks = this.SyntaxProvider.GetChunks(context, viewPath);

            var fileReferenceVisitor = new FileReferenceVisitor();

            fileReferenceVisitor.Accept(newEntry.Chunks);

            foreach (var useFile in fileReferenceVisitor.References)
            {
                var referencePath = this.ResolveReference(viewPath, useFile.Name);

                if (!string.IsNullOrEmpty(referencePath))
                {
                    useFile.FileContext = this.BindEntry(referencePath).FileContext;
                }
            }
        }
Esempio n. 2
0
 private void LoadInternal(string viewPath)
 {
     if (!string.IsNullOrEmpty(viewPath))
     {
         Entry          entry   = this.BindEntry(viewPath);
         VisitorContext context = new VisitorContext {
             ViewFolder               = this.ViewFolder,
             Prefix                   = this.Prefix,
             ExtensionFactory         = this.ExtensionFactory,
             PartialFileNames         = this.FindPartialFiles(viewPath),
             Bindings                 = this.FindBindings(viewPath),
             ParseSectionTagAsSegment = this.ParseSectionTagAsSegment,
             AttributeBehaviour       = this.AttributeBehaviour
         };
         entry.Chunks = this.SyntaxProvider.GetChunks(context, viewPath);
         FileReferenceVisitor visitor = new FileReferenceVisitor();
         visitor.Accept(entry.Chunks);
         foreach (RenderPartialChunk chunk in visitor.References)
         {
             string str = this.ResolveReference(viewPath, chunk.Name);
             if (!string.IsNullOrEmpty(str))
             {
                 chunk.FileContext = this.BindEntry(str).FileContext;
             }
         }
     }
 }