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

适用于