ZPT-Sharp  v1.0.0
Zope Page Templates for .NET
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
CSF.Zpt.Rendering.Model Class Referenceabstract

Represents the root of an object model. More...

Inheritance diagram for CSF.Zpt.Rendering.Model:
Collaboration diagram for CSF.Zpt.Rendering.Model:

Public Member Functions

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...
 
abstract IModel CreateChildModel ()
 Creates and returns a child 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...
 
abstract ExpressionResult Evaluate (string expression, IRenderingContext context)
 Evaluate the specified expression and return the result. 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

virtual IDictionary< string,
object > 
GetBuiltinDefinitions ()
 Gets a collection of the current model's built-in definitions. More...
 
abstract Model CreateTypedSiblingModel ()
 Override in implementor classes to create a strongly-typed instance of Model, using the same model-type as the implementor class. 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 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

Represents the root of an object model.

Constructor & Destructor Documentation

CSF.Zpt.Rendering.Model.Model ( IModel  parent,
IModel  root,
object  modelObject = null 
)
inline

Initializes a new instance of the CSF.Zpt.Rendering.Model class.

Parameters
parentA reference to the parent model instance, if applicable.
rootA reference to the root of the model hierarchy.
modelObjectThe model to be rendered.
CSF.Zpt.Rendering.Model.Model ( NamedObjectWrapper  options,
object  modelObject = null 
)
inline

Initializes a new root of the CSF.Zpt.Rendering.Model class.

Parameters
optionsKeyword options.
modelObjectThe model to be rendered.

Member Function Documentation

virtual void CSF.Zpt.Rendering.Model.AddError ( object  error)
inlinevirtual

Adds information about an encountered error to the current model instance.

Parameters
errorError.

Implements CSF.Zpt.Rendering.IModel.

virtual void CSF.Zpt.Rendering.Model.AddGlobal ( string  name,
object  value 
)
inlinevirtual

Adds a new item to the current local model, identified by a given name and containing a given value.

Parameters
nameThe new item name.
valueThe item value.

Implements CSF.Zpt.Rendering.IModelValueStore.

virtual void CSF.Zpt.Rendering.Model.AddLocal ( string  name,
object  value 
)
inlinevirtual

Adds a new item to the current local model, identified by a given name and containing a given value.

Parameters
nameThe new item name.
valueThe item value.

Implements CSF.Zpt.Rendering.IModelValueStore.

virtual void CSF.Zpt.Rendering.Model.AddRepetitionInfo ( IRepetitionInfo  info)
inlinevirtual

Adds information about a repetition to the current instance.

Parameters
infoThe repetition information.

Implements CSF.Zpt.Rendering.IModel.

abstract IModel CSF.Zpt.Rendering.Model.CreateChildModel ( )
pure virtual

Creates and returns a child Model instance.

Returns
The child model.

Implements CSF.Zpt.Rendering.IModel.

Implemented in CSF.Zpt.MVC.Tales.MvcTalesModel, and CSF.Zpt.Tales.TalesModel.

virtual IModel CSF.Zpt.Rendering.Model.CreateSiblingModel ( )
inlinevirtual

Creates and returns a sibling Model instance.

Returns
The sibling model.

Implements CSF.Zpt.Rendering.IModel.

abstract Model CSF.Zpt.Rendering.Model.CreateTypedSiblingModel ( )
protectedpure virtual

Override in implementor classes to create a strongly-typed instance of Model, using the same model-type as the implementor class.

Returns
The sibling model.

Implemented in CSF.Zpt.MVC.Tales.MvcTalesModel, and CSF.Zpt.Tales.TalesModel.

abstract ExpressionResult CSF.Zpt.Rendering.Model.Evaluate ( string  expression,
IRenderingContext  context 
)
pure virtual

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.IModel.

Implemented in CSF.Zpt.Tales.TalesModel.

virtual IDictionary<string,object> CSF.Zpt.Rendering.Model.GetAllDefinitions ( )
inlinevirtual

Gets all variable definitions for the current model instance.

Returns
The variable definitions.

Implements CSF.Zpt.Rendering.IModel.

virtual IDictionary<string,object> CSF.Zpt.Rendering.Model.GetAllLocalDefinitions ( )
inlineprotectedvirtual

Gets a dictionary containing all of the local variable definitions.

Returns
The all local definitions.
virtual IDictionary<string,object> CSF.Zpt.Rendering.Model.GetBuiltinDefinitions ( )
inlineprotectedvirtual

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

Returns
The built-in definitions.

Reimplemented in CSF.Zpt.Tales.TalesModel, and CSF.Zpt.MVC.Tales.MvcTalesModel.

virtual NamedObjectWrapper CSF.Zpt.Rendering.Model.GetKeywordOptions ( )
inlineprotectedvirtual

Gets the keyword options specified upon the current instance.

virtual RepetitionMetadataCollectionWrapper CSF.Zpt.Rendering.Model.GetRepetitionSummaries ( )
inlineprotectedvirtual

Gets the contextualised repetition summaries.

Returns
The repetition summaries.
virtual IDictionary<string,object> CSF.Zpt.Rendering.Model.MergeDefinitionsDictionaries ( IDictionary< string, object >  first,
IDictionary< string, object >  second 
)
inlineprotectedvirtual

Merges two dictionaries which contain variable definitions together.

The first dictionary will always 'win' in any naming conflicts. Thus if an identically-named deifinition exists in both the first and second dictionaries, then the value from the first will be used.

Returns
The result of the merge operation.
Parameters
firstThe first dictionary.
secondThe second dictionary.
virtual IEnumerable<IRepetitionInfo> CSF.Zpt.Rendering.Model.RecursivelyGetAllRepetitions ( )
inlineprotectedvirtual

Recursively gets all of the IRepetitionInfo instances from the current model and all of its parents.

Returns
The repetition information instances.
virtual void CSF.Zpt.Rendering.Model.RecursivelyGetAllRepetitions ( ref List< IRepetitionInfo repetitions)
inlineprotectedvirtual

Recursively gets all of the IRepetitionInfo instances from the current model and all of its parents.

Parameters
repetitionsThe repetitions retrieved so far.
virtual bool CSF.Zpt.Rendering.Model.TryGetItem ( string  name,
IRenderingContext  context,
out object  result 
)
inlineprotectedvirtual

Tries to get a named item from the current instance.

Returns
true, if an item was found, false otherwise.
Parameters
nameThe item name.
contextThe rendering context for which we are evaluating a result.
resultExposes the item which was found.
virtual bool CSF.Zpt.Rendering.Model.TryRecursivelyGetLocalItem ( string  name,
out object  result 
)
inlineprotectedvirtual

Tries recursively to get an item from the local scope exposed by the current instance and its parents.

Returns
true, if an item was found, false otherwise.
Parameters
nameThe item name.
resultExposes the item which was found.

Property Documentation

Model CSF.Zpt.Rendering.Model.Empty
staticget

Gets an empty model/null object.

The empty model.

virtual object CSF.Zpt.Rendering.Model.Error
get

Gets information about an error, or a null reference if no error was encountered.

The error.

virtual Dictionary<string,object> CSF.Zpt.Rendering.Model.GlobalDefinitions
getprotected

Gets the global definitions.

The global definitions.

virtual Dictionary<string,object> CSF.Zpt.Rendering.Model.LocalDefinitions
getprotected

Gets the local definitions.

The local definitions.

object CSF.Zpt.Rendering.Model.ModelObject
getprotected set

Gets the model object being rendered.

The model object.

virtual IModel CSF.Zpt.Rendering.Model.Parent
get

Gets a reference to the parent model (if applicable).

The parent.

virtual IRepetitionInfo CSF.Zpt.Rendering.Model.RepetitionInfo
getprotected

Gets the repetition info for the current model instance.

The repetition info.

virtual IModel CSF.Zpt.Rendering.Model.Root
getprotected

Gets a reference to the root model instance in the current hierarchy.

The root.


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