Click or drag to resize

FormatConverterT, TFormatTypeTryConvert Method

Tries to convert the specified instance from one format to another, returning success or failure.

Namespace:  AGI.Foundation.Infrastructure
Assembly:  AGI.Foundation.Core (in AGI.Foundation.Core.dll) Version: 24.2.419.0 (24.2.419.0)
Syntax
public bool TryConvert(
	TFormatType from,
	TFormatType to,
	T instance,
	out T result
)

Parameters

from
Type: TFormatType
The source TFormatType.
to
Type: TFormatType
The destination TFormatType.
instance
Type: T
The instance of T to convert.
result
Type: T
On return, the resulting instance of T equivalent to from, in the new TFormatTypeto.

Return Value

Type: Boolean
if from could be converted to the requested TFormatTypeto; otherwise .
Exceptions
ExceptionCondition
ArgumentException Thrown when there is no conversion defined from from to to.
See Also