Delegate TokenHandler<T>
- Namespace
- Microsoft.Practices.EnterpriseLibrary.Logging.Formatters
- Assembly
- Microsoft.Practices.EnterpriseLibrary.Logging.dll
Transforms a token definition from a string template into a Formatter<T>.
public delegate Formatter<T> TokenHandler<T>(string template, ref int currentIndex)
Parameters
Returns
- Formatter<T>
The Formatter<T> representing the token, or null if the parsing of the token was not successful.
Type Parameters
T
The type to format.
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 null should be returned.
Constructors
TokenHandler(object, nint)
public TokenHandler(object @object, nint method)
Parameters
Methods
BeginInvoke(string, ref int, AsyncCallback, object)
public virtual IAsyncResult BeginInvoke(string template, ref int currentIndex, AsyncCallback callback, object @object)
Parameters
template
stringcurrentIndex
intcallback
AsyncCallbackobject
object
Returns
EndInvoke(ref int, IAsyncResult)
public virtual Formatter<T> EndInvoke(ref int currentIndex, IAsyncResult result)
Parameters
currentIndex
intresult
IAsyncResult
Returns
- Formatter<T>
Invoke(string, ref int)
public virtual Formatter<T> Invoke(string template, ref int currentIndex)
Parameters
Returns
- Formatter<T>