ZPT-Sharp  v1.0.0
Zope Page Templates for .NET
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
CSF.Zpt.Tales.TalesModel Class Reference

An implementation of Model which makes use of the TALES: Template Attribute Language Expression Syntax for evaluating expressions. More...

Inheritance diagram for CSF.Zpt.Tales.TalesModel:
Collaboration diagram for CSF.Zpt.Tales.TalesModel:

Public Member Functions

override IModel CreateChildModel ()
 Creates and returns a child TalesModel instance. More...
 
override ExpressionResult Evaluate (string expression, IRenderingContext context)
 Evaluate the specified expression and return the result. More...
 
virtual ExpressionResult Evaluate (Expression talesExpression, IRenderingContext context)
 Evaluate the specified TALES expression and return the result. More...
 
virtual bool TryGetRootObject (string name, IRenderingContext context, out object result)
 Attempts to get a object instance from the root of the current model. More...
 
virtual bool TryGetLocalRootObject (string name, IZptElement element, out object result)
 Attempts to get a object instance from the root of the current model, but only searches local variable definitions. More...
 
 TalesModel (IEvaluatorSelector evaluatorRegistry, NamedObjectWrapper options=null, IExpressionFactory expressionCreator=null, object modelObject=null)
 Initializes a new instance of the CSF.Zpt.Tales.TalesModel class. More...
 
 TalesModel (IModel parent, IModel root, IEvaluatorSelector evaluatorRegistry, IExpressionFactory expressionCreator=null, object modelObject=null)
 Initializes a new instance of the CSF.Zpt.Tales.TalesModel class. More...
 
- Public Member Functions inherited from CSF.Zpt.Rendering.Model
virtual void AddLocal (string name, object value)
 Adds a new item to the current local model, identified by a given name and containing a given value. More...
 
virtual void AddGlobal (string name, object value)
 Adds a new item to the current local model, identified by a given name and containing a given value. More...
 
virtual void AddRepetitionInfo (IRepetitionInfo info)
 Adds information about a repetition to the current instance. More...
 
virtual void AddError (object error)
 Adds information about an encountered error to the current model instance. More...
 
virtual IModel CreateSiblingModel ()
 Creates and returns a sibling Model instance. More...
 
virtual IDictionary< string,
object > 
GetAllDefinitions ()
 Gets all variable definitions for the current model instance. More...
 
 Model (IModel parent, IModel root, object modelObject=null)
 Initializes a new instance of the CSF.Zpt.Rendering.Model class. More...
 
 Model (NamedObjectWrapper options, object modelObject=null)
 Initializes a new root of the CSF.Zpt.Rendering.Model class. More...
 

Protected Member Functions

override Model CreateTypedSiblingModel ()
 Creates an instance of TalesModel. More...
 
virtual BuiltinContextsContainer GetBuiltinContexts (IRenderingContext context)
 Gets the builtin contexts, associated with the CONTEXTS root path keyword. More...
 
override IDictionary< string,
object > 
GetBuiltinDefinitions ()
 Gets a collection of the current model's built-in definitions. More...
 
- Protected Member Functions inherited from CSF.Zpt.Rendering.Model
virtual bool TryGetItem (string name, IRenderingContext context, out object result)
 Tries to get a named item from the current instance. More...
 
virtual bool TryRecursivelyGetLocalItem (string name, out object result)
 Tries recursively to get an item from the local scope exposed by the current instance and its parents. More...
 
virtual IEnumerable
< IRepetitionInfo
RecursivelyGetAllRepetitions ()
 Recursively gets all of the IRepetitionInfo instances from the current model and all of its parents. More...
 
virtual void RecursivelyGetAllRepetitions (ref List< IRepetitionInfo > repetitions)
 Recursively gets all of the IRepetitionInfo instances from the current model and all of its parents. More...
 
virtual
RepetitionMetadataCollectionWrapper 
GetRepetitionSummaries ()
 Gets the contextualised repetition summaries. More...
 
virtual NamedObjectWrapper GetKeywordOptions ()
 Gets the keyword options specified upon the current instance. More...
 
virtual IDictionary< string,
object > 
MergeDefinitionsDictionaries (IDictionary< string, object > first, IDictionary< string, object > second)
 Merges two dictionaries which contain variable definitions together. More...
 
virtual IDictionary< string,
object > 
GetAllLocalDefinitions ()
 Gets a dictionary containing all of the local variable definitions. More...
 

Properties

virtual IEvaluatorSelector EvaluatorRegistry [get]
 Gets the evaluator registry. More...
 
- Properties inherited from CSF.Zpt.Rendering.Model
virtual Dictionary< string,
object > 
GlobalDefinitions [get]
 Gets the global definitions. More...
 
virtual Dictionary< string,
object > 
LocalDefinitions [get]
 Gets the local definitions. More...
 
virtual object Error [get]
 Gets information about an error, or a null reference if no error was encountered. More...
 
virtual IModel Parent [get]
 Gets a reference to the parent model (if applicable). More...
 
virtual IModel Root [get]
 Gets a reference to the root model instance in the current hierarchy. More...
 
virtual IRepetitionInfo RepetitionInfo [get]
 Gets the repetition info for the current model instance. More...
 
object ModelObject [get, protected set]
 Gets the model object being rendered. More...
 
static Model Empty [get]
 Gets an empty model/null object. More...
 
- Properties inherited from CSF.Zpt.Rendering.IModel
object Error [get]
 Gets information about an error, or a null reference if no error was encountered. More...
 
IModel Parent [get]
 Gets a reference to the parent model (if applicable). More...
 

Detailed Description

An implementation of Model which makes use of the TALES: Template Attribute Language Expression Syntax for evaluating expressions.

Constructor & Destructor Documentation

CSF.Zpt.Tales.TalesModel.TalesModel ( IEvaluatorSelector  evaluatorRegistry,
NamedObjectWrapper  options = null,
IExpressionFactory  expressionCreator = null,
object  modelObject = null 
)
inline

Initializes a new instance of the CSF.Zpt.Tales.TalesModel class.

Parameters
evaluatorRegistryEvaluator registry.
optionsOptions.
expressionCreatorThe expression factory to use.
modelObjectAn object to which the ZPT document is to be applied.
CSF.Zpt.Tales.TalesModel.TalesModel ( IModel  parent,
IModel  root,
IEvaluatorSelector  evaluatorRegistry,
IExpressionFactory  expressionCreator = null,
object  modelObject = null 
)
inline

Initializes a new instance of the CSF.Zpt.Tales.TalesModel class.

Parameters
parentThe parent model.
rootThe root model.
evaluatorRegistryThe expression evaluator registry.
expressionCreatorThe expression factory to use.
modelObjectAn object to which the ZPT document is to be applied.

Member Function Documentation

override IModel CSF.Zpt.Tales.TalesModel.CreateChildModel ( )
inlinevirtual

Creates and returns a child TalesModel instance.

Returns
The child model.

Implements CSF.Zpt.Rendering.Model.

Reimplemented in CSF.Zpt.MVC.Tales.MvcTalesModel.

override Model CSF.Zpt.Tales.TalesModel.CreateTypedSiblingModel ( )
inlineprotectedvirtual

Creates an instance of TalesModel.

Returns
The sibling model.

Implements CSF.Zpt.Rendering.Model.

Reimplemented in CSF.Zpt.MVC.Tales.MvcTalesModel.

override ExpressionResult CSF.Zpt.Tales.TalesModel.Evaluate ( string  expression,
IRenderingContext  context 
)
inlinevirtual

Evaluate the specified expression and return the result.

Parameters
expressionThe expression to evaluate.
contextThe rendering context for which we are evaluating a result.

Implements CSF.Zpt.Rendering.Model.

virtual ExpressionResult CSF.Zpt.Tales.TalesModel.Evaluate ( Expression  talesExpression,
IRenderingContext  context 
)
inlinevirtual

Evaluate the specified TALES expression and return the result.

Parameters
talesExpressionThe TALES expression to evaluate.
contextThe rendering context for which we are evaluating a result.

Implements CSF.Zpt.Tales.ITalesModel.

virtual BuiltinContextsContainer CSF.Zpt.Tales.TalesModel.GetBuiltinContexts ( IRenderingContext  context)
inlineprotectedvirtual

Gets the builtin contexts, associated with the CONTEXTS root path keyword.

Returns
The builtin contexts.
Parameters
contextThe current rendering context.

Reimplemented in CSF.Zpt.MVC.Tales.MvcTalesModel.

override IDictionary<string, object> CSF.Zpt.Tales.TalesModel.GetBuiltinDefinitions ( )
inlineprotectedvirtual

Gets a collection of the current model's built-in definitions.

Returns
The built-in definitions.

Reimplemented from CSF.Zpt.Rendering.Model.

Reimplemented in CSF.Zpt.MVC.Tales.MvcTalesModel.

virtual bool CSF.Zpt.Tales.TalesModel.TryGetLocalRootObject ( string  name,
IZptElement  element,
out object  result 
)
inlinevirtual

Attempts to get a object instance from the root of the current model, but only searches local variable definitions.

Returns
true, if a root item was found matching the given name , false otherwise.
Parameters
nameThe name of the desired item.
elementThe ZPT element.
resultExposes the found object if this method returns true. The value is undefined if this method returns false.

Implements CSF.Zpt.Tales.ITalesModel.

virtual bool CSF.Zpt.Tales.TalesModel.TryGetRootObject ( string  name,
IRenderingContext  context,
out object  result 
)
inlinevirtual

Attempts to get a object instance from the root of the current model.

Returns
true, if a root item was found matching the given name , false otherwise.
Parameters
nameThe name of the desired item.
contextThe rendering context for which the item search is being performed.
resultExposes the found object if this method returns true. The value is undefined if this method returns false.

Implements CSF.Zpt.Tales.ITalesModel.

Property Documentation

virtual IEvaluatorSelector CSF.Zpt.Tales.TalesModel.EvaluatorRegistry
getprotected

Gets the evaluator registry.

The evaluator registry.


The documentation for this class was generated from the following file: