RecommendedAsConfigurableAttribute::RecommendedAsConfigurable Property
.NET Framework (current version)
Gets a value indicating whether the property this attribute is bound to can be used as an application setting.
Assembly: System (in System.dll)
Property Value
Type: System::Booleantrue if the property this attribute is bound to can be used as an application setting; otherwise, false.
The following example checks to see whether MyProperty is bindable. First the code gets the attributes for MyProperty by:
Retrieving a PropertyDescriptorCollection with all the properties for the object.
Indexing into the PropertyDescriptorCollection to get MyProperty.
Saving the attributes for this property in the attributes variable.
Then the code sets myAttribute to the value of the RecommendedAsConfigurableAttribute in the AttributeCollection and checks whether the property is bindable.
// 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. }
.NET Framework
Available since 1.1
Available since 1.1
Show: