我正在使用從屬性類繼承的自定義屬性。我使用它是這樣的:如何創建重複的允許屬性
[MyCustomAttribute("CONTROL")]
[MyCustomAttribute("ALT")]
[MyCustomAttribute("SHIFT")]
[MyCustomAttribute("D")]
public void setColor()
{
}
但顯示「重複'MyCustomAttribute'屬性」錯誤。
如何創建重複允許的屬性?
只是好奇 - 爲什麼一個「密封」的課? – 2009-02-16 15:09:12
Microsoft建議儘可能密封屬性類:http://msdn.microsoft.com/en-us/library/2ab31zeh.aspx – 2009-02-16 15:11:02