RecommendedAsConfigurableAttribute.RecommendedAsConfigurable 属性    
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取一个值,该值指示该特性绑定到的属性是否可用作应用程序设置。
public:
 property bool RecommendedAsConfigurable { bool get(); };public bool RecommendedAsConfigurable { get; }member this.RecommendedAsConfigurable : boolPublic ReadOnly Property RecommendedAsConfigurable As Boolean属性值
如果该特性所绑定到的属性可以作为应用程序设置使用,则为 true;否则为 false。
示例
以下示例检查是否 MyProperty 可绑定。 首先,代码按以下方式获取 的属性 MyProperty :
- 使用 PropertyDescriptorCollection 对象的所有属性检索 。 
- 将索引编制到 中 PropertyDescriptorCollection 以获取 - MyProperty。
- 将此属性的属性保存在 attributes 变量中。 
然后,代码将 设置为 myAttribute 中 AttributeCollection 的值RecommendedAsConfigurableAttribute,并检查 属性是否可绑定。
// Gets the attributes for the property.
AttributeCollection^ attributes = TypeDescriptor::GetProperties( this )[ "MyProperty" ]->Attributes;
// Checks to see if the property is recommended as configurable.
RecommendedAsConfigurableAttribute^ myAttribute = dynamic_cast<RecommendedAsConfigurableAttribute^>(attributes[ RecommendedAsConfigurableAttribute::typeid ]);
if ( myAttribute->RecommendedAsConfigurable )
{
   // Insert code here.
}
// Gets the attributes for the property.
AttributeCollection attributes = 
   TypeDescriptor.GetProperties(this)["MyProperty"].Attributes;
// Checks to see if the property is recommended as configurable.
RecommendedAsConfigurableAttribute myAttribute = 
   (RecommendedAsConfigurableAttribute)attributes[typeof(RecommendedAsConfigurableAttribute)];
if(myAttribute.RecommendedAsConfigurable) {
   // Insert code here.
}
' Gets the attributes for the property.
Dim attributes As AttributeCollection = _
   TypeDescriptor.GetProperties(Me)("MyProperty").Attributes
       
' Checks to see if the property is recommended as configurable.
Dim myAttribute As RecommendedAsConfigurableAttribute = _
   CType(attributes(GetType(RecommendedAsConfigurableAttribute)), _
   RecommendedAsConfigurableAttribute)
   
If myAttribute.RecommendedAsConfigurable Then
    ' Insert code here.
End If