TokenHandler<T> Delegate

Transforms a token definition from a string template into a Formatter<T>.

Namespace: Microsoft.Practices.EnterpriseLibrary.Logging.Formatters
Assembly: Microsoft.Practices.EnterpriseLibrary.Logging (in Microsoft.Practices.EnterpriseLibrary.Logging.dll) Version: (6.0.1304.0)

public delegate Formatter<T> TokenHandler<T>(
	string template,
	ref int currentIndex


Type: System.String
The template being parsed.
Type: System.Int32%
The current index in the template.

The type to format.

Return Value

Type: Formatter<T>
The Formatter<T> representing the token, or nulla null reference (Nothing in Visual Basic) if the parsing of the token was not successful.

A token handler gets control of the template parsing process right after the token name has been consumed, and consumes the rest of the token definition advancing the currentIndex pointer to the end of the token.

If the text following the token name cannot be parsed into the expected token, the currentIndex should still be updated and nulla null reference (Nothing in Visual Basic) should be returned.