2014-03-04 86 views
0

我有一個列表屬性,它是用System.Attribute類修飾的。是否可以在列表的屬性級別包含一個檢查以僅包含不同的值?System.Attribute排除重複值

[ConfigSettingList(typeof(string),Description="Contains a list of supported handheld devices . Default is the below list .")] 
     public List<string> HandHeldDevices 
     { 
      get 
      { 
       if (_handHeldDevices == null) 
       { 
        _handHeldDevices = new List<string> { "Android", "webOS", "iPhone", "iPad", "iPod", "BlackBerry", "IEMobile", "Opera Mini" }; 
       } 
       return _handHeldDevices; 
      } 
     } 
     private List<string> _handHeldDevices; 

ConfigSettingList繼承自System.Attribute。我想檢查不同的值。

+0

你是什麼意思?你能詳細說明一下嗎? –

+1

使用詞典代替 – rt2800

+0

請不要包含有關問題標題中使用的語言的信息,除非在沒有它的情況下沒有意義。標籤用於此目的。 –

回答