RecommendedAsConfigurableAttribute.RecommendedAsConfigurable Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a value indicating whether the property this attribute is bound to can be used as an application setting.
public:
property bool RecommendedAsConfigurable { bool get(); };
public bool RecommendedAsConfigurable { get; }
member this.RecommendedAsConfigurable : bool
Public ReadOnly Property RecommendedAsConfigurable As Boolean
Property Value
true
if the property this attribute is bound to can be used as an application setting; otherwise, false
.
Examples
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.
}
// 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