protected override void Visit(RenderSectionChunk chunk) { if (string.IsNullOrEmpty(chunk.Name)) { Accept(_currentPartial.Body); } else if (_currentPartial.Sections.ContainsKey(chunk.Name)) { Accept(_currentPartial.Sections[chunk.Name]); } else { Accept(chunk.Default); } }
protected override void Visit(RenderSectionChunk chunk) { var currentPartial = ExitRenderPartial(); if (string.IsNullOrEmpty(chunk.Name)) { Accept(currentPartial.Body); } else if (currentPartial.Sections.ContainsKey(chunk.Name)) { Accept(currentPartial.Sections[chunk.Name]); } else { Accept(chunk.Default); } EnterRenderPartial(currentPartial); }
protected override void Visit(RenderSectionChunk chunk) { var outer = ExitRenderPartial(); if (string.IsNullOrEmpty(chunk.Name)) { Accept(outer.Body); } else if (outer.Sections.ContainsKey(chunk.Name)) { Accept(outer.Sections[chunk.Name]); } else { EnterRenderPartial(outer); Accept(chunk.Default); ExitRenderPartial(outer); } EnterRenderPartial(outer); }
protected override void Visit(RenderSectionChunk chunk) { RenderPartialChunk chunk2 = base.ExitRenderPartial(); if (string.IsNullOrEmpty(chunk.Name)) { base.Accept(chunk2.Body); } else if (chunk2.Sections.ContainsKey(chunk.Name)) { base.Accept(chunk2.Sections[chunk.Name]); } else { base.EnterRenderPartial(chunk2); base.Accept(chunk.Default); base.ExitRenderPartial(chunk2); } base.EnterRenderPartial(chunk2); }
protected abstract void Visit(RenderSectionChunk chunk);
private void VisitRender(SpecialNode node, SpecialNodeInspector inspector) { var partial = inspector.TakeAttribute("partial"); if (partial != null) { var scope = new ScopeChunk { Position = Locate(inspector.OriginalNode) }; Chunks.Add(scope); using (new Frame(this, scope.Body)) { foreach (var attr in inspector.Attributes) { Chunks.Add(new LocalVariableChunk { Name = attr.Name, Value = AsCode(attr), Position = Locate(attr) }); } var renderPartial = new RenderPartialChunk { Name = partial.Value, Position = Locate(inspector.OriginalNode) }; Chunks.Add(renderPartial); using (new Frame(this, renderPartial.Body, renderPartial.Sections)) { Accept(inspector.Body); } } } else { var sectionAttr = inspector.TakeAttribute("section"); string sectionName = null; if (sectionAttr != null) sectionName = sectionAttr.Value; var scope = new ScopeChunk { Position = Locate(inspector.OriginalNode) }; Chunks.Add(scope); using (new Frame(this, scope.Body)) { foreach (var attr in inspector.Attributes) { Chunks.Add(new LocalVariableChunk { Name = attr.Name, Value = AsCode(attr), Position = Locate(attr) }); } var render = new RenderSectionChunk { Name = sectionName }; Chunks.Add(render); using (new Frame(this, render.Default)) { Accept(inspector.Body); } } } }
private void VisitRender(SpecialNode node, SpecialNodeInspector inspector) { var partial = inspector.TakeAttribute("partial"); if (partial != null) { var scope = new ScopeChunk { Position = Locate(inspector.OriginalNode) }; Chunks.Add(scope); using (new Frame(this, scope.Body)) { foreach (var attr in inspector.Attributes) { Chunks.Add(new LocalVariableChunk { Name = attr.Name, Value = AsCode(attr), Position = Locate(attr) }); } var renderPartial = new RenderPartialChunk { Name = partial.Value, Position = Locate(inspector.OriginalNode) }; Chunks.Add(renderPartial); using (new Frame(this, renderPartial.Body, renderPartial.Sections)) { Accept(inspector.Body); } } } else { var sectionAttr = inspector.TakeAttribute("section"); string sectionName = null; if (sectionAttr != null) { sectionName = sectionAttr.Value; } var scope = new ScopeChunk { Position = Locate(inspector.OriginalNode) }; Chunks.Add(scope); using (new Frame(this, scope.Body)) { foreach (var attr in inspector.Attributes) { Chunks.Add(new LocalVariableChunk { Name = attr.Name, Value = AsCode(attr), Position = Locate(attr) }); } var render = new RenderSectionChunk { Name = sectionName }; Chunks.Add(render); using (new Frame(this, render.Default)) { Accept(inspector.Body); } } } }
protected override void Visit(RenderSectionChunk chunk) { }
private void VisitRender(SpecialNode node, SpecialNodeInspector inspector) { AttributeNode node2 = inspector.TakeAttribute("partial"); if (node2 != null) { ScopeChunk chunk = new ScopeChunk { Position = this.Locate(inspector.OriginalNode) }; this.Chunks.Add(chunk); using (new Frame(this, chunk.Body)) { foreach (AttributeNode node3 in inspector.Attributes) { LocalVariableChunk chunk2 = new LocalVariableChunk { Name = node3.Name, Value = this.AsTextOrientedCode(node3), Position = this.Locate(node3) }; this.Chunks.Add(chunk2); } RenderPartialChunk chunk3 = new RenderPartialChunk { Name = node2.Value, Position = this.Locate(inspector.OriginalNode) }; this.Chunks.Add(chunk3); using (new Frame(this, chunk3.Body, chunk3.Sections)) { base.Accept(inspector.Body); } return; } } AttributeNode node4 = inspector.TakeAttribute("segment"); if (base.Context.ParseSectionTagAsSegment && (node4 == null)) { node4 = inspector.TakeAttribute("section"); } string str = null; if (node4 != null) { str = node4.Value; } ScopeChunk item = new ScopeChunk { Position = this.Locate(inspector.OriginalNode) }; this.Chunks.Add(item); using (new Frame(this, item.Body)) { foreach (AttributeNode node5 in inspector.Attributes) { LocalVariableChunk chunk7 = new LocalVariableChunk { Name = node5.Name, Value = this.AsTextOrientedCode(node5), Position = this.Locate(node5) }; this.Chunks.Add(chunk7); } RenderSectionChunk chunk8 = new RenderSectionChunk { Name = str }; this.Chunks.Add(chunk8); using (new Frame(this, chunk8.Default)) { base.Accept(inspector.Body); } } }