Method ToString
ToString(object?, object, ITypeDescriptorContext?, CultureInfo?, bool)
Converts the value
to its equivalent string
representation, using the specified context and culture information.
public virtual string? ToString(object? sender, object value, ITypeDescriptorContext? context, CultureInfo? culture, bool useInvariantConversion)
Parameters
sender
objectAn object which calls the converter.
value
objectA value for convertion.
context
ITypeDescriptorContextAn ITypeDescriptorContext that provides a format context.
culture
CultureInfoCultureInfo used for the conversion. If null is passed, the current culture is assumed.
useInvariantConversion
bool
Returns
ToString(object?, object)
Converts the value
to its equivalent string
representation.
public virtual string? ToString(object? sender, object value)
Parameters
Returns
ToString(object?, object, IFormatProvider?)
Converts the value
to its equivalent string
representation
using the specified culture-specific format information.
public virtual string? ToString(object? sender, object value, IFormatProvider? provider)
Parameters
sender
objectAn object which calls the converter.
value
objectA value for convertion.
provider
IFormatProviderAn object that supplies culture-specific formatting information.
Returns
ToString(object?, object, string?)
Converts the value
to its equivalent string
representation,
using the specified format.
public virtual string? ToString(object? sender, object value, string? format)
Parameters
sender
objectAn object which calls the converter.
value
objectA value for convertion.
format
stringA standard or custom format string.
Returns
ToString(object?, object, string?, IFormatProvider?)
Converts the value
to its equivalent string
representation using
the specified format and culture-specific format information.
public string? ToString(object? sender, object value, string? format, IFormatProvider? provider)
Parameters
sender
objectAn object which calls the converter.
value
objectA value for convertion.
format
stringA standard or custom format string.
provider
IFormatProviderAn object that supplies culture-specific formatting information.