TypeConverter.ConvertFromInvariantString Метод
Определение
Преобразует данное значение в тип этого преобразователя, используя нейтральные язык и региональные параметры.Converts the value to a type of this converter, using the invariant culture.
Перегрузки
ConvertFromInvariantString(String) |
Преобразует заданную строку к типу этого преобразователя, используя нейтральные язык и региональные параметры.Converts the given string to the type of this converter, using the invariant culture. |
ConvertFromInvariantString(ITypeDescriptorContext, String) |
Преобразует заданную строку к типу этого преобразователя, используя нейтральные язык и региональные параметры вместе с заданным контекстом.Converts the given string to the type of this converter, using the invariant culture and the specified context. |
ConvertFromInvariantString(String)
Преобразует заданную строку к типу этого преобразователя, используя нейтральные язык и региональные параметры.Converts the given string to the type of this converter, using the invariant culture.
public:
System::Object ^ ConvertFromInvariantString(System::String ^ text);
public object ConvertFromInvariantString (string text);
member this.ConvertFromInvariantString : string -> obj
Public Function ConvertFromInvariantString (text As String) As Object
Параметры
Возвращаемое значение
Объект Object, представляющий преобразованный текст.An Object that represents the converted text.
Исключения
Преобразование не может быть выполнено.The conversion cannot be performed.
Комментарии
Реализация по умолчанию всегда возвращает значение null
.The default implementation always returns null
.
См. также раздел
Применяется к
ConvertFromInvariantString(ITypeDescriptorContext, String)
Преобразует заданную строку к типу этого преобразователя, используя нейтральные язык и региональные параметры вместе с заданным контекстом.Converts the given string to the type of this converter, using the invariant culture and the specified context.
public:
System::Object ^ ConvertFromInvariantString(System::ComponentModel::ITypeDescriptorContext ^ context, System::String ^ text);
public object ConvertFromInvariantString (System.ComponentModel.ITypeDescriptorContext context, string text);
member this.ConvertFromInvariantString : System.ComponentModel.ITypeDescriptorContext * string -> obj
Public Function ConvertFromInvariantString (context As ITypeDescriptorContext, text As String) As Object
Параметры
- context
- ITypeDescriptorContext
Объект ITypeDescriptorContext, предоставляющий контекст формата.An ITypeDescriptorContext that provides a format context.
Возвращаемое значение
Объект Object, представляющий преобразованный текст.An Object that represents the converted text.
Исключения
Преобразование не может быть выполнено.The conversion cannot be performed.
Комментарии
Если строка не может быть преобразована в соответствующий объект, возникает исключение.An exception is raised if the string cannot be converted into the appropriate object. Реализация по умолчанию всегда возвращает значение null
.The default implementation always returns null
.
Для получения дополнительных сведений о среде, из которой вызывается этот преобразователь, используйте параметр context
.Use the context
parameter to extract additional information about the environment from which this converter is invoked. Этот параметр может быть null
, поэтому всегда следует его проверять.This parameter can be null
, so always check it. Свойства объекта контекста могут также возвращать значение null
.Also, properties on the context object can return null
.