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

驗證時要根據的值。

傳回

用於執行驗證的值。

例外狀況

valuenull,而 propertyName 為 "IsTransient"。

備註

ValidatePropertyValue每當屬性字典中設定值時,就會呼叫 方法。 使用這個方法,您可以在認可物件之前變更物件的值,或藉由擲回例外狀況來拒絕它。

適用於