語言

ToolboxItem.ValidatePropertyType(String, Object, Type, Boolean) 方法

定義

驗證物件屬於特定類型。

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)

參數

propertyName
String

用來驗證房產名稱。

value
Object

可選的價值可供驗證。

expectedType
Type

房產的預期類型。

allowNull
Boolean

true 允許 null;否則, false。

例外狀況

value 是 null,allowNull 是 false。

value 並非由 expectedType所指定的類型。

備註

此 ValidatePropertyType 方法被稱為該方法的 ValidatePropertyValue 輔助方法。

適用於