TypeConverter.ConvertToInvariantString Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Converts the specified value to a culture-invariant string representation.
Overloads
ConvertToInvariantString(Object) |
Converts the specified value to a culture-invariant string representation. |
ConvertToInvariantString(ITypeDescriptorContext, Object) |
Converts the specified value to a culture-invariant string representation, using the specified context. |
ConvertToInvariantString(Object)
- Source:
- TypeConverter.cs
- Source:
- TypeConverter.cs
- Source:
- TypeConverter.cs
Converts the specified value to a culture-invariant string representation.
public:
System::String ^ ConvertToInvariantString(System::Object ^ value);
public string ConvertToInvariantString (object value);
public string? ConvertToInvariantString (object? value);
member this.ConvertToInvariantString : obj -> string
Public Function ConvertToInvariantString (value As Object) As String
Parameters
Returns
A String that represents the converted value.
Exceptions
The conversion cannot be performed.
Remarks
The context
parameter can be used to extract additional information about the environment from which this converter is being invoked. This can be null
, so always check. 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
ConvertToInvariantString(ITypeDescriptorContext, Object)
- Source:
- TypeConverter.cs
- Source:
- TypeConverter.cs
- Source:
- TypeConverter.cs
Converts the specified value to a culture-invariant string representation, using the specified context.
public:
System::String ^ ConvertToInvariantString(System::ComponentModel::ITypeDescriptorContext ^ context, System::Object ^ value);
public string ConvertToInvariantString (System.ComponentModel.ITypeDescriptorContext context, object value);
public string? ConvertToInvariantString (System.ComponentModel.ITypeDescriptorContext? context, object? value);
member this.ConvertToInvariantString : System.ComponentModel.ITypeDescriptorContext * obj -> string
Public Function ConvertToInvariantString (context As ITypeDescriptorContext, value As Object) As String
Parameters
- context
- ITypeDescriptorContext
An ITypeDescriptorContext that provides a format context.
Returns
A String that represents the converted value.
Exceptions
The conversion cannot be performed.
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
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: I hele 2024 udfaser vi GitHub-problemer som feedbackmekanisme for indhold og erstatter det med et nyt feedbacksystem. Du kan få flere oplysninger under:Indsend og få vist feedback om