ToolboxItem.ValidatePropertyType(String, Object, Type, Boolean) Metode
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Memvalidasi bahwa objek berjenis tertentu.
protected:
void ValidatePropertyType(System::String ^ propertyName, System::Object ^ value, Type ^ expectedType, bool allowNull);
protected void ValidatePropertyType (string propertyName, object value, Type expectedType, bool allowNull);
protected void ValidatePropertyType (string propertyName, object? value, Type expectedType, bool allowNull);
member this.ValidatePropertyType : string * obj * Type * bool -> unit
Protected Sub ValidatePropertyType (propertyName As String, value As Object, expectedType As Type, allowNull As Boolean)
Parameter
- propertyName
- String
Nama properti yang akan divalidasi.
- value
- Object
Nilai opsional untuk divalidasi.
- expectedType
- Type
Jenis properti yang diharapkan.
- allowNull
- Boolean
true untuk mengizinkan null; jika tidak, false.
Pengecualian
value adalah null, dan allowNull adalah false.
value bukan tipe yang ditentukan oleh expectedType.
Keterangan
Metode ValidatePropertyType ini disebut sebagai metode pembantu untuk metode .ValidatePropertyValue