RecommendedAsConfigurableAttribute.RecommendedAsConfigurable Propiedad

Definición

Obtiene un valor que indica si la propiedad a la que está enlazado este atributo se puede utilizar como configuración de la aplicación.

public:
 property bool RecommendedAsConfigurable { bool get(); };
public bool RecommendedAsConfigurable { get; }
member this.RecommendedAsConfigurable : bool
Public ReadOnly Property RecommendedAsConfigurable As Boolean

Valor de propiedad

Boolean

true si la propiedad a la que está enlazado este atributo se puede utilizar como configuración de la aplicación; en todos los demás casos, false.

Ejemplos

En el ejemplo siguiente se comprueba si MyProperty se puede enlazar. En primer lugar, el código obtiene los atributos de MyProperty por:

A continuación, el código establece myAttribute en el valor de RecommendedAsConfigurableAttribute en AttributeCollection y comprueba si la propiedad se puede enlazar.

// 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

Se aplica a

Consulte también