[This is preliminary documentation and is subject to change.]

Converts the value to the specified type. If the value is unable to be converted, the value is checked whether it assignable to the specified type.

Namespace:  Facebook.Json.Utilities
Assembly:  Facebook (in Facebook.dll) Version: 0.2009.3.23 (0.2009.3.23)

Syntax

C#
public static bool TryConvertOrCast(
	Object initialValue,
	CultureInfo culture,
	Type targetType,
	out Object convertedValue
)
Visual Basic (Declaration)
Public Shared Function TryConvertOrCast ( _
	initialValue As Object, _
	culture As CultureInfo, _
	targetType As Type, _
	<OutAttribute> ByRef convertedValue As Object _
) As Boolean
Visual C++
public:
static bool TryConvertOrCast(
	Object^ initialValue, 
	CultureInfo^ culture, 
	Type^ targetType, 
	[OutAttribute] Object^% convertedValue
)

Parameters

initialValue
Type: System..::.Object
The value to convert.
culture
Type: System.Globalization..::.CultureInfo
The culture to use when converting.
targetType
Type: System..::.Type
The type to convert the value to.
convertedValue
Type: System..::.Object %
The converted value if the conversion was successful or the default value of T if it failed.

Return Value

true if initialValue was converted successfully or is assignable; otherwise, false.

See Also

ConvertUtils Class
TryConvertOrCast Overload
Facebook.Json.Utilities Namespace