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.0.0 (6.0.1304.0)

Syntax

public delegate Formatter<T> TokenHandler<T>(
    string template,
    ref int currentIndex
)
'Declaration
Public Delegate Function TokenHandler(Of T) ( 
    template As String,
    ByRef currentIndex As Integer
) As Formatter(Of T)
generic<typename T>
public delegate Formatter<T>^ TokenHandler(
    String^ template, 
    int% currentIndex
)

Parameters

  • currentIndex
    Type: System.Int32%
    The current index in the template.

Type Parameters

  • T
    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.

Remarks

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.

See Also

Microsoft.Practices.EnterpriseLibrary.Logging.Formatters Namespace