Linguaggio

LocalizablePropertyDescriptionAttribute.GetLocalizedValue Metodo

Definizione

Ottiene una stringa che contiene il valore localizzato del LocalizablePropertyDescriptionAttribute.

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

Valori restituiti

Una stringa contenente il valore localizzato del LocalizablePropertyDescriptionAttribute.

Esempio

Il seguente esempio di codice utilizza il GetLocalizedValue metodo per restituire una versione localizzata della stringa da utilizzare come nome visualizzato nell'interfaccia utente.

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();  
    }  
}  

Si applica a