LocalizablePropertyDescriptionAttribute.GetLocalizedValue Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a String containing the localized value of the LocalizablePropertyDescriptionAttribute.
public:
System::String ^ GetLocalizedValue();
public string GetLocalizedValue ();
member this.GetLocalizedValue : unit -> string
Public Function GetLocalizedValue () As String
Returns
A String containing the localized value of the LocalizablePropertyDescriptionAttribute.
Examples
The following code example uses the GetLocalizedValue method to return a localized version of the string to be used as the displayed name in a user interface.
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();
}
}