แก้ไข

แชร์ผ่าน


MobileTypeNameConverter.ConvertFrom Method

Definition

Converts the given object to the type of this converter, using the specified context and culture information. This API is obsolete. For information about how to develop ASP.NET mobile applications, see Mobile Apps & Sites with ASP.NET.

public:
 override System::Object ^ ConvertFrom(System::ComponentModel::ITypeDescriptorContext ^ ctx, System::Globalization::CultureInfo ^ ci, System::Object ^ data);
public override object ConvertFrom (System.ComponentModel.ITypeDescriptorContext ctx, System.Globalization.CultureInfo ci, object data);
override this.ConvertFrom : System.ComponentModel.ITypeDescriptorContext * System.Globalization.CultureInfo * obj -> obj
Public Overrides Function ConvertFrom (ctx As ITypeDescriptorContext, ci As CultureInfo, data As Object) As Object

Parameters

ctx
ITypeDescriptorContext

An ITypeDescriptorContext that provides a format context.

ci
CultureInfo

The CultureInfo to use as the current culture.

data
Object

The Object to convert.

Returns

An Object that represents the converted value.

Exceptions

Calling GetType() on data returns null.

Remarks

This implementation of ConvertFrom casts data as a string and then calls the GetType method on it. The result, a new Type, is then returned. However, if the result is null, an exception will be thrown.

Applies to

See also