C# Class NVelocity.Runtime.VelocimacroManager

Manages VMs in namespaces. Currently, two namespace modes are supported: *
  • flat - all allowable VMs are in the global namespace
  • local - inline VMs are added to it's own template namespace
* Thanks to Jose Alberto Fernandez for some ideas incorporated here. *
Exibir arquivo Open project: rasmus-toftdahl-olesen/NVelocity Class Usage Examples

Public Methods

Method Description
AddVM ( String vmName, String macroBody, String argArray, String ns ) : bool

Adds a VM definition to the cache.

DumpNamespace ( String ns ) : bool

Removes the VMs and the namespace from the manager. Used when a template is reloaded to avoid accumulating drek

GetLibraryName ( String vmName, String ns ) : String
get ( String vmName, String ns ) : VelocimacroProxy

gets a new living VelocimacroProxy object by the name / source template duple

Private Methods

Method Description
AddNamespace ( String ns ) : Hashtable

adds a namespace to the namespaces

GetNamespace ( String ns ) : Hashtable

public switch to let external user of manager to control namespace usage indep of properties. That way, for example, at startup the library files are loaded into global namespace returns the hash for the specified namespace. Will not create a new one if it doesn't exist

GetNamespace ( String ns, bool addIfNew ) : Hashtable

returns the hash for the specified namespace, and if it doesn't exist will create a new one and add it to the namespaces

InitBlock ( ) : void
UsingNamespaces ( String ns ) : bool

determines if currently using namespaces.

VelocimacroManager ( IRuntimeServices rs ) : System

Adds the global namespace to the hash.

Method Details

AddVM() public method

Adds a VM definition to the cache.
public AddVM ( String vmName, String macroBody, String argArray, String ns ) : bool
vmName String
macroBody String
argArray String
ns String
return bool

DumpNamespace() public method

Removes the VMs and the namespace from the manager. Used when a template is reloaded to avoid accumulating drek
public DumpNamespace ( String ns ) : bool
ns String namespace to dump ///
return bool

GetLibraryName() public method

public GetLibraryName ( String vmName, String ns ) : String
vmName String
ns String
return String

get() public method

gets a new living VelocimacroProxy object by the name / source template duple
public get ( String vmName, String ns ) : VelocimacroProxy
vmName String
ns String
return VelocimacroProxy