Compartilhar via


LocalizablePropertyDescriptionAttribute.GetLocalizedValue Método

Definição

Obtém uma cadeia de caracteres que contém o valor localizado do LocalizablePropertyDescriptionAttribute.

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

Retornos

Uma cadeia de caracteres que contém o valor localizado do LocalizablePropertyDescriptionAttribute.

Exemplos

O exemplo de código a seguir usa o GetLocalizedValue método para retornar uma versão localizada da cadeia de caracteres a ser usada como o nome exibido em uma interface do usuário.

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

Aplica-se a