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

要檢查的值。

傳回

true 如果該值被允許且可加入標準值集合; false 若該值無法加入標準值集合。

備註

此方法會被呼叫於每個與此 ReferenceConverter 類型相符的值,以及每個與該類型相符的元件。 預設情況下,此方法會回傳 true,也就是說,它允許將該值加入標準值集合中。

給繼承者的注意事項

當你不想將值加入標準值集合時,可以覆寫此方法。

適用於

另請參閱