Condividi tramite


LocalizablePropertyDescriptionAttribute.GetLocalizedValue Metodo

Definizione

Ottiene un valore String contenente il valore localizzato dell'oggetto LocalizablePropertyDescriptionAttribute.

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

Restituisce

Valore String contenente il valore localizzato dell'oggetto LocalizablePropertyDescriptionAttribute.

Esempio

Nell'esempio di codice seguente viene utilizzato il GetLocalizedValue metodo per restituire una versione localizzata della stringa da utilizzare come nome visualizzato in un'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