ToolboxItem.ValidatePropertyType(String, Object, Type, Boolean) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
驗證物件屬於特定類型。
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 輔助方法。