ReferenceConverter.IsValueAllowed(ITypeDescriptorContext, Object) 方法
定义
返回一个值,该值指示某个特定值是否可以添加到标准值集合中。Returns a value indicating whether a particular value can be added to the standard values collection.
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,提供附加上下文。An ITypeDescriptorContext that provides an additional context.
- value
- Object
要检查的值。The value to check.
返回
如果该值是允许值并可以添加到标准值集合中,则为 true;如果该值不能添加到标准值集合中,则为 false。true if the value is allowed and can be added to the standard values collection; false if the value cannot be added to the standard values collection.
注解
对于与此关联的类型 ReferenceConverter 以及每个为关联类型的组件,将调用此方法。This method is called for each value that matches the type associated with this ReferenceConverter and for each component found that is of the associated type. 默认情况下,此方法返回 true ,即允许将值添加到标准值集合中。By default, this method returns true, that is, it allows adding the value into the standard values collection.
继承者说明
如果您不希望向标准值集合添加值,请重写此方法。Override this method when you do not want to add a value to the standard values collection.