NVelocity.App.Tools
Class VelocityFormatter.VelocityAlternator

Class that returns alternating values in a template. It stores a list of alternate Strings, whenever alternate() is called it switches to the next in the list. The current alternate is retrieved through toString() - i.e. just by referencing the object in a Velocity template. For an example of usage see the makeAlternator() method below.

Field Summary
string[] alternates
int current

Constructor Summary
VelocityFormatter.VelocityAlternator(NVelocity.App.Tools.VelocityFormatter enclosingInstance, string[] alternates)
         Constructor takes an array of Strings. *

Property Summary
NVelocity.App.Tools.VelocityFormatter Enclosing_Instance

Method Summary
string alternate()
         Alternates to the next in the list. *
string ToString()
         Returns the current alternate. *

Methods inherited from class System.Object
Equals, Finalize, GetHashCode, GetType, MemberwiseClone


Field Detail

alternates

protected internal string[] alternates


current

protected internal int current

Constructor Detail

VelocityFormatter.VelocityAlternator

public VelocityFormatter.VelocityAlternator(NVelocity.App.Tools.VelocityFormatter enclosingInstance,
                                            string[] alternates)

Constructor takes an array of Strings. *

Parameters:
alternates - A String[].
Property Detail

Enclosing_Instance

public NVelocity.App.Tools.VelocityFormatter Enclosing_Instance

Method Detail

alternate

public string alternate()

Alternates to the next in the list. *

Returns:
The current alternate in the sequence.

ToString

public string ToString()

Returns the current alternate. *

Returns:
A String.