各位大侠,我在一段配置自定义ConfigurationSection的时候,看到下面一段代码不是很了解是什么意思,恳请大家帮忙解释解释,当然越详细越好,Thanks.
Code
//这个地方的this[""]代表什么意思?
[ConfigurationProperty("", IsDefaultCollection = true)]
public UrlConfigCollection Uris
{
get{
return (UrlConfigCollection)this[""];
}
}
//这里是UrlConfigCollection类的实现
class UrlConfigCollection : ConfigurationElementCollection<string, UrlConfigElement>
{
public override ConfigurationElementCollectionType CollectionType
{
get {
return ConfigurationElementCollectionType.AddRemoveClearMap;
}
}
protected override string ElementName
{
get { return "urls"; }
}
protected override string GetElementKey(UrlConfigElement element)
{
return element.Name;
}
}