ZPT-Sharp
v1.0.0
Zope Page Templates for .NET
|
An implementation of Model which makes use of the TALES: Template Attribute Language Expression Syntax for evaluating expressions. More...
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... | |
![]() | |
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... | |
![]() | |
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... | |
![]() | |
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... | |
![]() | |
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... | |
An implementation of Model which makes use of the TALES: Template Attribute Language Expression Syntax for evaluating expressions.
|
inline |
Initializes a new instance of the CSF.Zpt.Tales.TalesModel class.
evaluatorRegistry | Evaluator registry. |
options | Options. |
expressionCreator | The expression factory to use. |
modelObject | An object to which the ZPT document is to be applied. |
|
inline |
Initializes a new instance of the CSF.Zpt.Tales.TalesModel class.
parent | The parent model. |
root | The root model. |
evaluatorRegistry | The expression evaluator registry. |
expressionCreator | The expression factory to use. |
modelObject | An object to which the ZPT document is to be applied. |
|
inlinevirtual |
Creates and returns a child TalesModel instance.
Implements CSF.Zpt.Rendering.Model.
Reimplemented in CSF.Zpt.MVC.Tales.MvcTalesModel.
|
inlineprotectedvirtual |
Creates an instance of TalesModel.
Implements CSF.Zpt.Rendering.Model.
Reimplemented in CSF.Zpt.MVC.Tales.MvcTalesModel.
|
inlinevirtual |
Evaluate the specified expression and return the result.
expression | The expression to evaluate. |
context | The rendering context for which we are evaluating a result. |
Implements CSF.Zpt.Rendering.Model.
|
inlinevirtual |
Evaluate the specified TALES expression and return the result.
talesExpression | The TALES expression to evaluate. |
context | The rendering context for which we are evaluating a result. |
Implements CSF.Zpt.Tales.ITalesModel.
|
inlineprotectedvirtual |
Gets the builtin contexts, associated with the CONTEXTS
root path keyword.
context | The current rendering context. |
Reimplemented in CSF.Zpt.MVC.Tales.MvcTalesModel.
|
inlineprotectedvirtual |
Gets a collection of the current model's built-in definitions.
Reimplemented from CSF.Zpt.Rendering.Model.
Reimplemented in CSF.Zpt.MVC.Tales.MvcTalesModel.
|
inlinevirtual |
Attempts to get a object instance from the root of the current model, but only searches local variable definitions.
true
, if a root item was found matching the given name , false
otherwise. name | The name of the desired item. |
element | The ZPT element. |
result | Exposes the found object if this method returns true . The value is undefined if this method returns false . |
Implements CSF.Zpt.Tales.ITalesModel.
|
inlinevirtual |
Attempts to get a object instance from the root of the current model.
true
, if a root item was found matching the given name , false
otherwise. name | The name of the desired item. |
context | The rendering context for which the item search is being performed. |
result | Exposes the found object if this method returns true . The value is undefined if this method returns false . |
Implements CSF.Zpt.Tales.ITalesModel.
|
getprotected |
Gets the evaluator registry.
The evaluator registry.