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回 ,也就是說,它允許將值新增至標準值集合。

給繼承者的注意事項

當您不想將值新增至標準值集合時,請覆寫此方法。

適用於

另請參閱