语言

LocalizablePropertyCategoryAttribute(Type, String) 构造函数

定义

使用指定的类型和属性名称初始化该 LocalizablePropertyCategoryAttribute 类的新实例。

public:
 LocalizablePropertyCategoryAttribute(Type ^ type, System::String ^ propertyName);
public LocalizablePropertyCategoryAttribute(Type type, string propertyName);
new Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyCategoryAttribute : Type * string -> Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyCategoryAttribute
Public Sub New (type As Type, propertyName As String)

参数

type
Type

包含所 propertyName引用属性的类型名称。

propertyName
String

该属性 type 的名称返回了局部化的属性类别。

示例

以下代码示例展示了实现该属性的类。

public class MyTask : Task  
{  
[LocalizablePropertyCategory (typeof(LocalizedStrings),"MyGeneralCategory")]  
     public string MyProperty  
{ get; set; }  
}  
internal class LocalizedStrings  
    {  
        public static string MyGeneralCategory  
        {  
            get  
            {  
                // Return the localized string.  
            }  
        }  
    }  

注解

该属性必须是静态的,并且返回一个 String。

适用于