PostSharp 2023.0 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Reflection Namespace / Custom­Reflection­Binder Class / Custom­Reflection­Binder Methods / Custom­Reflection­Binder.​Change­Type Method

CustomReflectionBinder.ChangeType Method

Changes the type of the given Object to the given Type.

Namespace:  PostSharp.Reflection
Assembly:  PostSharp (in PostSharp.dll) Version: 2023.0.3.0 (2023.0.3.0)
public override Object ChangeType(
	Object value,
	Type type,
	CultureInfo culture


Type: System.Object
The object to change into a new Type.
Type: System.Type
The new Type that value will become.
Type: System.Globalization.CultureInfo
An instance of CultureInfo that is used to control the coercion of data types. If culture is null, the CultureInfo for the current thread is used.Note   For example, this parameter is necessary to convert a String that represents 1000 to a Double value, because 1000 is represented differently by different cultures.

Return Value

Type: Object
An object that contains the given value as the new type.
See Also