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每当在属性字典中设置值时,将调用该方法。 使用此方法,可以在提交对象之前更改对象的值,或通过引发异常来拒绝它。

适用于