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