語言

ToolboxItem.ValidatePropertyValue(String, Object) 方法

定義

在屬性被指派到屬性字典之前,先驗證該屬性。

protected:
 virtual System::Object ^ ValidatePropertyValue(System::String ^ propertyName, System::Object ^ value);
protected virtual object ValidatePropertyValue(string propertyName, object value);
protected virtual object? ValidatePropertyValue(string propertyName, object? value);
abstract member ValidatePropertyValue : string * obj -> obj
override this.ValidatePropertyValue : string * obj -> obj
Protected Overridable Function ValidatePropertyValue (propertyName As String, value As Object) As Object

參數

propertyName
String

用來驗證房產名稱。

value
Object

要驗證的價值。

傳回

用於驗證的值。

例外狀況

value 是 null,且 propertyName 是「瞬移」。

備註

ValidatePropertyValue每當屬性字典中設定值時,該方法就會被呼叫。 透過此方法,你可以在提交物件前更改其值,或透過拋出例外來拒絕它。

適用於