LocalizablePropertyDescriptionAttribute.GetLocalizedValue 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取包含本地化值的 LocalizablePropertyDescriptionAttribute字符串。
public:
System::String ^ GetLocalizedValue();
public string GetLocalizedValue ();
member this.GetLocalizedValue : unit -> string
Public Function GetLocalizedValue () As String
返回
包含本地化值的 LocalizablePropertyDescriptionAttribute字符串。
示例
下面的代码示例使用 GetLocalizedValue 该方法返回要用作用户界面中显示名称的字符串的本地化版本。
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();
}
}