TypeConverter.ConvertToString TypeConverter.ConvertToString TypeConverter.ConvertToString TypeConverter.ConvertToString Method

Definition

Converts the specified value to a string representation.

Overloads

ConvertToString(ITypeDescriptorContext, CultureInfo, Object) ConvertToString(ITypeDescriptorContext, CultureInfo, Object) ConvertToString(ITypeDescriptorContext, CultureInfo, Object) ConvertToString(ITypeDescriptorContext, CultureInfo, Object)

Converts the given value to a string representation, using the specified context and culture information.

ConvertToString(Object) ConvertToString(Object) ConvertToString(Object) ConvertToString(Object)

Converts the specified value to a string representation.

ConvertToString(ITypeDescriptorContext, Object) ConvertToString(ITypeDescriptorContext, Object) ConvertToString(ITypeDescriptorContext, Object) ConvertToString(ITypeDescriptorContext, Object)

Converts the given value to a string representation, using the given context.

ConvertToString(ITypeDescriptorContext, CultureInfo, Object) ConvertToString(ITypeDescriptorContext, CultureInfo, Object) ConvertToString(ITypeDescriptorContext, CultureInfo, Object) ConvertToString(ITypeDescriptorContext, CultureInfo, Object)

Converts the given value to a string representation, using the specified context and culture information.

public:
 System::String ^ ConvertToString(System::ComponentModel::ITypeDescriptorContext ^ context, System::Globalization::CultureInfo ^ culture, System::Object ^ value);
public string ConvertToString (System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value);
member this.ConvertToString : System.ComponentModel.ITypeDescriptorContext * System.Globalization.CultureInfo * obj -> string
Public Function ConvertToString (context As ITypeDescriptorContext, culture As CultureInfo, value As Object) As String

Parameters

culture
CultureInfo CultureInfo CultureInfo CultureInfo

A CultureInfo. If null is passed, the current culture is assumed.

value
Object Object Object Object

The Object to convert.

Returns

An Object that represents the converted value.

Exceptions

Remarks

Use the context parameter to extract additional information about the environment from which this converter is invoked. This parameter can be null, so always check it. Also, properties on the context object can return null.

Depending on the implementation of the value formatter, it might be possible to pass the returned string back into the value formatter to re-create an instance of the object.

See Also

ConvertToString(Object) ConvertToString(Object) ConvertToString(Object) ConvertToString(Object)

Converts the specified value to a string representation.

public:
 System::String ^ ConvertToString(System::Object ^ value);
public string ConvertToString (object value);
member this.ConvertToString : obj -> string
Public Function ConvertToString (value As Object) As String

Parameters

value
Object Object Object Object

The Object to convert.

Returns

An Object that represents the converted value.

Exceptions

Examples

For an example on this function, see the TypeConverter class.

Remarks

Depending on the implementation of the value formatter, it might be possible to pass the returned string back into the value formatter to re-create an instance of the object.

ConvertToString(ITypeDescriptorContext, Object) ConvertToString(ITypeDescriptorContext, Object) ConvertToString(ITypeDescriptorContext, Object) ConvertToString(ITypeDescriptorContext, Object)

Converts the given value to a string representation, using the given context.

public:
 System::String ^ ConvertToString(System::ComponentModel::ITypeDescriptorContext ^ context, System::Object ^ value);
public string ConvertToString (System.ComponentModel.ITypeDescriptorContext context, object value);
member this.ConvertToString : System.ComponentModel.ITypeDescriptorContext * obj -> string
Public Function ConvertToString (context As ITypeDescriptorContext, value As Object) As String

Parameters

value
Object Object Object Object

The Object to convert.

Returns

An Object that represents the converted value.

Exceptions

Remarks

Use the context parameter to extract additional information about the environment from which this converter is invoked. This parameter can be null, so always check it. Also, properties on the context object can return null.

Depending on the implementation of the value formatter, it might be possible to pass the returned string back into the value formatter to re-create an instance of the object.

See Also

Applies to