C# Class NVelocity.App.Tools.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.
Mostra file Open project: nats/castle-1.0.3-mono

Protected Properties

Property Type Description
alternates String[]
current int

Public Methods

Method Description
Alternate ( ) : String

Alternates to the next in the list.

ToString ( ) : String

Returns the current alternate.

VelocityAlternator ( ) : System

Constructor takes an array of Strings.

Method Details

Alternate() public method

Alternates to the next in the list.
public Alternate ( ) : String
return String

ToString() public method

Returns the current alternate.
public ToString ( ) : String
return String

VelocityAlternator() public method

Constructor takes an array of Strings.
public VelocityAlternator ( ) : System
return System

Property Details

alternates protected_oe property

protected String[] alternates
return String[]

current protected_oe property

protected int current
return int