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

Expands a METAL macro and splices it into its source document. More...

Inheritance diagram for CSF.Zpt.Metal.MacroExpander:
Collaboration diagram for CSF.Zpt.Metal.MacroExpander:

Public Member Functions

virtual IRenderingContext ExpandMacros (IRenderingContext context)
 Expands the given context, replacing it with a new context - representing a macro - if it is required. More...
 
virtual IRenderingContext ExtendAndSubstitute (IRenderingContext context, IZptElement macro)
 Extends a given macro and then makes substitutions into the source context. More...
 
virtual IRenderingContext ExtendAndSubstitute (IRenderingContext context, IZptElement macro, ref IList< IRenderingContext > macroStack, IMacroSubstituter substitutionStrategy)
 Extends a given macro and then makes substitutions into the source context. More...
 
virtual IRenderingContext HandleNoUsedMacro (IRenderingContext context)
 Takes appropriate actions when there is no use-macro directive present in a given context. More...
 
IZptElement GetUsedMacro (IRenderingContext context)
 Gets a reference to the macro used by a given rendering context, if any. More...
 
IZptElement GetExtendedMacro (IRenderingContext context)
 Gets a reference to a 'parent' macro to be extended by the given context, if any. More...
 
IRenderingContext GetFullyExtendedContext (IRenderingContext macroContext, ref IList< IRenderingContext > macroStack)
 Gets an instance of IRenderingContext from a context instance representing a METAL macro, representing a fully-extended chain of macros. More...
 
 MacroExpander ()
 Initializes a new instance of the CSF.Zpt.Metal.MacroExpander class. More...
 
 MacroExpander (IMacroFinder finder=null, IMacroSubstituter substituter=null, IMacroSubstituter extensionSubstitutor=null)
 Initializes a new instance of the CSF.Zpt.Metal.MacroExpander class. More...
 

Detailed Description

Expands a METAL macro and splices it into its source document.

Constructor & Destructor Documentation

CSF.Zpt.Metal.MacroExpander.MacroExpander ( )
inline

Initializes a new instance of the CSF.Zpt.Metal.MacroExpander class.

CSF.Zpt.Metal.MacroExpander.MacroExpander ( IMacroFinder  finder = null,
IMacroSubstituter  substituter = null,
IMacroSubstituter  extensionSubstitutor = null 
)
inline

Initializes a new instance of the CSF.Zpt.Metal.MacroExpander class.

Parameters
finderA macro finder instance, or a null reference (in which case one will be constructed).
substituterA substituter service for regular macro substitution, or a null reference (in which case one will be constructed).
extensionSubstitutorA substituter service for macro extension, or a null reference (in which case one will be constructed).

Member Function Documentation

virtual IRenderingContext CSF.Zpt.Metal.MacroExpander.ExpandMacros ( IRenderingContext  context)
inlinevirtual

Expands the given context, replacing it with a new context - representing a macro - if it is required.

Parameters
contextThe context to expand.

Implements CSF.Zpt.Metal.IMacroExpander.

virtual IRenderingContext CSF.Zpt.Metal.MacroExpander.ExtendAndSubstitute ( IRenderingContext  context,
IZptElement  macro 
)
inlinevirtual

Extends a given macro and then makes substitutions into the source context.

Returns
The resultant rendering context after the substitutions are performed.
Parameters
contextThe rendering context.
macroThe macro element to extend and use for substitutions.
virtual IRenderingContext CSF.Zpt.Metal.MacroExpander.ExtendAndSubstitute ( IRenderingContext  context,
IZptElement  macro,
ref IList< IRenderingContext macroStack,
IMacroSubstituter  substitutionStrategy 
)
inlinevirtual

Extends a given macro and then makes substitutions into the source context.

Returns
The resultant rendering context after the substitutions are performed.
Parameters
contextThe rendering context.
macroThe macro element to extend and use for substitutions.
macroStackThe collection of macros passed through to get to this point.
substitutionStrategyThe macro substitution strategy to use.
IZptElement CSF.Zpt.Metal.MacroExpander.GetExtendedMacro ( IRenderingContext  context)
inline

Gets a reference to a 'parent' macro to be extended by the given context, if any.

Returns
The to be extended by the current context, or a null reference if there is no macro extension.
Parameters
contextThe rendering context.
IRenderingContext CSF.Zpt.Metal.MacroExpander.GetFullyExtendedContext ( IRenderingContext  macroContext,
ref IList< IRenderingContext macroStack 
)
inline

Gets an instance of IRenderingContext from a context instance representing a METAL macro, representing a fully-extended chain of macros.

This method fully applies METAL extension to the given macro context. If the macro extends another then the fully chain of extensions is applied here. If it does not then the input parameter is returned unchanged.

Returns
The fully extended context.
Parameters
macroContextA rendering context representing a macro which might extend other macros.
macroStackThe collection of macros passed through to get to this point.
IZptElement CSF.Zpt.Metal.MacroExpander.GetUsedMacro ( IRenderingContext  context)
inline

Gets a reference to the macro used by a given rendering context, if any.

Returns
The used macro element, or a null reference if there is no used macro.
Parameters
contextThe rendering context.
virtual IRenderingContext CSF.Zpt.Metal.MacroExpander.HandleNoUsedMacro ( IRenderingContext  context)
inlinevirtual

Takes appropriate actions when there is no use-macro directive present in a given context.

Returns
The exposed context (which will be the same as the input context).
Parameters
contextThe rendering context.

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