DataMemberConverter.ConvertFrom 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
使用指定的內容,將指定的物件轉換成相關控制項屬性的型別。 這個 API 已經過時。 如需如何開發 ASP.NET 行動應用程式的資訊,請參閱 具有 ASP.NET 的Mobile Apps & Sites。
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,表示屬性所屬的資料繫結元件或控制項。
- culture
- CultureInfo
CultureInfo 物件,可用來提供其他文化特性 (Culture) 資訊。
- value
- Object
要從中轉換的值。
傳回
如果 value
不是 null
且包含字串,則為包含 value
的字串,否則為空字串 ("")。
例外狀況
value
不是 null
,也不是字串。
備註
注意
您通常不會直接存取類型轉換器。 TypeConverter的實作適用於在設計時間由數據綁定控件使用,並以 屬性上的 具現化TypeConverterAttribute。