LocalizablePropertyCategoryAttribute(Type, String) 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
使用指定的类型和属性名称初始化 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
。