GuidConverter.ConvertFrom(ITypeDescriptorContext, CultureInfo, Object) 方法

定义

将给定对象转换为 GUID 对象。

public:
 override System::Object ^ ConvertFrom(System::ComponentModel::ITypeDescriptorContext ^ context, System::Globalization::CultureInfo ^ culture, System::Object ^ value);
public override object ConvertFrom (System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value);
public override object? ConvertFrom (System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object value);
override this.ConvertFrom : System.ComponentModel.ITypeDescriptorContext * System.Globalization.CultureInfo * obj -> obj
Public Overrides Function ConvertFrom (context As ITypeDescriptorContext, culture As CultureInfo, value As Object) As Object

参数

context
ITypeDescriptorContext

一个 ITypeDescriptorContext,用于提供格式上下文。

culture
CultureInfo

一个可选的 CultureInfo。 如果未提供区域性设置,则使用当前区域性。

value
Object

要转换的 Object

返回

表示转换的 valueObject

例外

无法执行转换。

注解

此转换器只能将 GUID 对象与字符串进行转换和转换。

context 参数可用于提取有关从中调用该转换器的环境的附加信息。 此参数可能为 null,因此总是需要检查。 同样,上下文对象的属性可以返回 null

适用于

另请参阅