语言

ReferenceConverter.IsValueAllowed(ITypeDescriptorContext, Object) 方法

定义

返回一个值,该值指示是否可以将特定值添加到标准值集合中。

protected:
 virtual bool IsValueAllowed(System::ComponentModel::ITypeDescriptorContext ^ context, System::Object ^ value);
protected virtual bool IsValueAllowed(System.ComponentModel.ITypeDescriptorContext context, object value);
abstract member IsValueAllowed : System.ComponentModel.ITypeDescriptorContext * obj -> bool
override this.IsValueAllowed : System.ComponentModel.ITypeDescriptorContext * obj -> bool
Protected Overridable Function IsValueAllowed (context As ITypeDescriptorContext, value As Object) As Boolean

参数

context
ITypeDescriptorContext

提供其他上下文的一个 ITypeDescriptorContext 。

value
Object

要检查的值。

返回

如果允许该值并且可添加到标准值集合中,则为 如果无法将值添加到标准值集合中,则为 。

注解

对于与与此 ReferenceConverter 关联的类型匹配的每个值以及找到的关联类型的每个组件,都会调用此方法。 默认情况下,此方法返回 true,即允许将值添加到标准值集合中。

继承者说明

如果不想向标准值集合添加值,请重写此方法。

适用于

另请参阅