【发布时间】:2014-03-04 06:07:59
【问题描述】:
我有一个用 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 。我想检查不同的值。
【问题讨论】:
-
你这是什么意思?你能详细说明一下吗?
-
改用字典
-
请不要在问题标题中包含有关所用语言的信息,除非没有它就没有意义。标记用于此目的。
标签: c# .net web-config custom-attributes