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: 23.1.416.0 (23.1.416.0)
Syntaxpublic void RegisterConversion(
TFormatType from,
TFormatType to,
FormatConversionCallback<T, TFormatType> conversion,
TryFormatConversionCallback<T, TFormatType> tryConversion
)
Public Sub RegisterConversion (
from As TFormatType,
to As TFormatType,
conversion As FormatConversionCallback(Of T, TFormatType),
tryConversion As TryFormatConversionCallback(Of T, TFormatType)
)
public:
void RegisterConversion(
TFormatType from,
TFormatType to,
FormatConversionCallback<T, TFormatType>^ conversion,
TryFormatConversionCallback<T, TFormatType>^ tryConversion
)
member RegisterConversion :
from : 'TFormatType *
to : 'TFormatType *
conversion : FormatConversionCallback<'T, 'TFormatType> *
tryConversion : TryFormatConversionCallback<'T, 'TFormatType> -> unit
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.
ExceptionsException | Condition |
---|
ArgumentException |
Thrown when registering a conversion between identical formats. The parameters
from and to cannot be equal.
|
See Also