Share via


LocalizablePropertyDescriptionAttribute.GetLocalizedValue Methode

Definition

Ruft eine Zeichenfolge ab, die den lokalisierten Wert des LocalizablePropertyDescriptionAttribute.

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

Gibt zurück

Eine Zeichenfolge, die den lokalisierten Wert des LocalizablePropertyDescriptionAttribute.

Beispiele

Im folgenden Codebeispiel wird die GetLocalizedValue Methode verwendet, um eine lokalisierte Version der Zeichenfolge zurückzugeben, die als angezeigter Name auf einer Benutzeroberfläche verwendet werden soll.

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

Gilt für: