语言

LocalizablePropertyDescriptionAttribute.GetLocalizedValue 方法

定义

获得包含 局部值的 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();  
    }  
}  

适用于