C# Класс Veil.Parser.SyntaxTree

Factory methods for creating syntax tree nodes
Показать файл Открыть проект

Открытые методы

Метод Описание
Block ( SourceLocation location ) : BlockNode

Create a sequential block of nodes

Conditional ( ExpressionNode expression, SourceLocation location, BlockNode trueBlock, BlockNode falseBlock = null ) : ConditionalNode

Evaluates an expression and chooses between two blocks based on the truthy-ness of the result

Extend ( string templateName, SourceLocation location, SyntaxTreeNode>.IDictionary overrides = null ) : ExtendTemplateNode

Defines a template that extends another template e.g. MasterPages Extend nodes must be the root of a syntax tree

Flush ( SourceLocation location ) : FlushNode

Flushes the TextWriter. Used to optimize responses in web applications.

Helper ( HelperExpressionNode helperExpression, BlockNode block, SourceLocation location ) : SyntaxTreeNode
Include ( string templateName, ExpressionNode modelExpression, SourceLocation location ) : IncludeTemplateNode

Execute another template in the scope of the provided model

Iterate ( ExpressionNode collectionExpression, SourceLocation location, BlockNode body, BlockNode emptyBody = null ) : IterateNode

Iterate a collection and execute the body block scoped to each item in the collection. Optionally execute an empty block when there are no items to iterate

Override ( string overrideName, SourceLocation location, bool isOptional = false ) : OverridePointNode

Defines a point in a template that can be overridden when the template is extended.

Override ( string overrideName, SyntaxTreeNode defaultContent, SourceLocation location ) : OverridePointNode

Defines an optional point in a template that can be overridden when the template is extended. If the point is not overridden then the specified content is used by default

ScopeNode ( ExpressionNode modelToScopeTo, SyntaxTreeNode node, SourceLocation location ) : ScopedNode

Scopes a node to a new model

WriteExpression ( ExpressionNode expression, SourceLocation location, bool htmlEncode = false ) : WriteExpressionNode

Evaluate an expression and write the value to the TextWriter

WriteString ( string content, SourceLocation location ) : WriteLiteralNode

Write a string literal to the TextWriter

Описание методов

Block() публичный статический Метод

Create a sequential block of nodes
public static Block ( SourceLocation location ) : BlockNode
location SourceLocation
Результат Veil.Parser.Nodes.BlockNode

Conditional() публичный статический Метод

Evaluates an expression and chooses between two blocks based on the truthy-ness of the result
public static Conditional ( ExpressionNode expression, SourceLocation location, BlockNode trueBlock, BlockNode falseBlock = null ) : ConditionalNode
expression ExpressionNode The expression to evaluate
location SourceLocation
trueBlock Veil.Parser.Nodes.BlockNode The block to execute when the expression is true
falseBlock Veil.Parser.Nodes.BlockNode The block to evaluate when the expression is false
Результат Veil.Parser.Nodes.ConditionalNode

Extend() публичный статический Метод

Defines a template that extends another template e.g. MasterPages Extend nodes must be the root of a syntax tree
public static Extend ( string templateName, SourceLocation location, SyntaxTreeNode>.IDictionary overrides = null ) : ExtendTemplateNode
templateName string The name of the template to extend. It will be loaded from the
location SourceLocation
overrides SyntaxTreeNode>.IDictionary A set of overrides for the defined in the template being extended.
Результат Veil.Parser.Nodes.ExtendTemplateNode

Flush() публичный статический Метод

Flushes the TextWriter. Used to optimize responses in web applications.
public static Flush ( SourceLocation location ) : FlushNode
location SourceLocation
Результат FlushNode

Helper() публичный статический Метод

public static Helper ( HelperExpressionNode helperExpression, BlockNode block, SourceLocation location ) : SyntaxTreeNode
helperExpression HelperExpressionNode
block Veil.Parser.Nodes.BlockNode
location SourceLocation
Результат SyntaxTreeNode

Include() публичный статический Метод

Execute another template in the scope of the provided model
public static Include ( string templateName, ExpressionNode modelExpression, SourceLocation location ) : IncludeTemplateNode
templateName string The name of the template to execute. It will be loaded from the
modelExpression ExpressionNode An expression for the model to be used as the root scope when executing the template
location SourceLocation
Результат Veil.Parser.Nodes.IncludeTemplateNode

Iterate() публичный статический Метод

Iterate a collection and execute the body block scoped to each item in the collection. Optionally execute an empty block when there are no items to iterate
public static Iterate ( ExpressionNode collectionExpression, SourceLocation location, BlockNode body, BlockNode emptyBody = null ) : IterateNode
collectionExpression ExpressionNode expression to load the collection
location SourceLocation
body Veil.Parser.Nodes.BlockNode Block to execute in the scope of each item
emptyBody Veil.Parser.Nodes.BlockNode Block to execute when there are no items in the collection
Результат Veil.Parser.Nodes.IterateNode

Override() публичный статический Метод

Defines a point in a template that can be overridden when the template is extended.
public static Override ( string overrideName, SourceLocation location, bool isOptional = false ) : OverridePointNode
overrideName string The name of the override which must match that specified in the overriding template
location SourceLocation
isOptional bool Indicates whether an exception should be thrown if the override is missing
Результат Veil.Parser.Nodes.OverridePointNode

Override() публичный статический Метод

Defines an optional point in a template that can be overridden when the template is extended. If the point is not overridden then the specified content is used by default
public static Override ( string overrideName, SyntaxTreeNode defaultContent, SourceLocation location ) : OverridePointNode
overrideName string The name of the override which must match that specified in the overriding template
defaultContent SyntaxTreeNode The content to use when the point is not overridden
location SourceLocation
Результат Veil.Parser.Nodes.OverridePointNode

ScopeNode() публичный статический Метод

Scopes a node to a new model
public static ScopeNode ( ExpressionNode modelToScopeTo, SyntaxTreeNode node, SourceLocation location ) : ScopedNode
modelToScopeTo ExpressionNode An expression that evaluates to the model to scope to
node SyntaxTreeNode The node to execute in the new scope
location SourceLocation
Результат Veil.Parser.Nodes.ScopedNode

WriteExpression() публичный статический Метод

Evaluate an expression and write the value to the TextWriter
public static WriteExpression ( ExpressionNode expression, SourceLocation location, bool htmlEncode = false ) : WriteExpressionNode
expression ExpressionNode The expression to be written
location SourceLocation
htmlEncode bool Indicates whether the content should be html encoded before being written
Результат WriteExpressionNode

WriteString() публичный статический Метод

Write a string literal to the TextWriter
public static WriteString ( string content, SourceLocation location ) : WriteLiteralNode
content string The string to be written
location SourceLocation
Результат Veil.Parser.Nodes.WriteLiteralNode