GuidConverter.ConvertFrom(ITypeDescriptorContext, CultureInfo, Object) 方法
定义
将给定对象转换为 GUID 对象。Converts the given object to a GUID object.
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);
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,用于提供格式上下文。An ITypeDescriptorContext that provides a format context.
- culture
- CultureInfo
一个可选的 CultureInfo。An optional CultureInfo. 如果未提供区域性设置,则使用当前区域性。If not supplied, the current culture is assumed.
返回
表示转换的 value 的 Object。An Object that represents the converted value.
例外
无法执行转换。The conversion cannot be performed.
注解
此转换器只能将 GUID 对象与字符串相互转换。This converter can only convert a GUID object to and from a string.
context 参数可用于提取有关从中调用该转换器的环境的附加信息。The context parameter can be used to extract additional information about the environment this converter is being invoked from. 此参数可能为 null,因此总是需要检查。This can be null, so always check. 同样,上下文对象的属性可以返回 null。Also, properties on the context object can return null.