Click or drag to resize

FormatConverterT, TFormatTypeRegisterConversion Method (TFormatType, TFormatType, FormatConversionCallbackT, TFormatType, TryFormatConversionCallbackT, TFormatType)

Registers a conversion between formats.

Namespace:  AGI.Foundation.Infrastructure
Assembly:  AGI.Foundation.Core (in AGI.Foundation.Core.dll) Version: 24.1.418.0 (24.1.418.0)
Syntax
public void RegisterConversion(
	TFormatType from,
	TFormatType to,
	FormatConversionCallback<T, TFormatType> conversion,
	TryFormatConversionCallback<T, TFormatType> tryConversion
)

Parameters

from
Type: TFormatType
The source format.
to
Type: TFormatType
The destination format.
conversion
Type: AGI.Foundation.InfrastructureFormatConversionCallbackT, TFormatType
A delegate referring to a function to convert from from to to.
tryConversion
Type: AGI.Foundation.InfrastructureTryFormatConversionCallbackT, TFormatType
A delegate referring to a function to try converting from from to to, returning success or failure.
Exceptions
ExceptionCondition
ArgumentException Thrown when registering a conversion between identical formats. The parameters from and to cannot be equal.
See Also