C# Class NVelocity.Runtime.Directive.Foreach

Foreach directive used for moving through arrays, or objects that provide an Iterator.
Inheritance: Directive
显示文件 Open project: rasmus-toftdahl-olesen/NVelocity

Public Methods

Method Description
CreateNestedDirective ( String name ) : Directive
Init ( IRuntimeServices rs, IInternalContextAdapter context, INode node ) : void

simple init - init the tree and get the elementKey from the AST

Render ( IInternalContextAdapter context, TextWriter writer, INode node ) : bool

renders the #foreach() block

SupportsNestedDirective ( String name ) : bool

Private Methods

Method Description
Foreach ( ) : System
GetIterator ( IInternalContextAdapter context, INode node ) : IEnumerator

returns an Iterator to the collection in the #foreach()

PrepareSections ( INode node ) : INode[][]
ProcessSection ( ForeachSectionEnum sectionEnumType, INode sections, IInternalContextAdapter context, TextWriter writer ) : void

Method Details

CreateNestedDirective() public method

public CreateNestedDirective ( String name ) : Directive
name String
return Directive

Init() public method

simple init - init the tree and get the elementKey from the AST
public Init ( IRuntimeServices rs, IInternalContextAdapter context, INode node ) : void
rs IRuntimeServices
context IInternalContextAdapter
node INode
return void

Render() public method

renders the #foreach() block
public Render ( IInternalContextAdapter context, TextWriter writer, INode node ) : bool
context IInternalContextAdapter
writer System.IO.TextWriter
node INode
return bool

SupportsNestedDirective() public method

public SupportsNestedDirective ( String name ) : bool
name String
return bool