LocalizablePropertyDescriptionAttribute.GetLocalizedValue Méthode

Définition

Obtient une chaîne contenant la valeur localisée du LocalizablePropertyDescriptionAttribute.

public:
 System::String ^ GetLocalizedValue();
public string GetLocalizedValue ();
member this.GetLocalizedValue : unit -> string
Public Function GetLocalizedValue () As String

Retours

Chaîne contenant la valeur localisée du LocalizablePropertyDescriptionAttribute.

Exemples

L’exemple de code suivant utilise la GetLocalizedValue méthode pour retourner une version localisée de la chaîne à utiliser comme nom affiché dans une interface utilisateur.

public override string DisplayLocPropertyName  
{  
    {  
        AttributeCollection attributes = this.Attributes;  
            if ( null == attributes )  
                // Your code here.  
                LocalizablePropertyDescriptionAttribute localizablePropDescAttr = attributes[ typeof ( LocalizablePropertyDescriptionAttribute ) ] as LocalizablePropertyDescriptionAttribute;  
                if ( null == localizablePropDescAttr)  
                    // Return your data or value.  
                else   
                   // Return the localized description.  
                    return localizablePropertyDescAttribute.GetLocalizedValue();  
    }  
}  

S’applique à