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

適用於