Mercurial > pub > bltoolkit
comparison Source/Configuration/ElementCollectionBase.cs @ 0:f990fcb411a9
Копия текущей версии из github
author | cin |
---|---|
date | Thu, 27 Mar 2014 21:46:09 +0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f990fcb411a9 |
---|---|
1 using System; | |
2 using System.Configuration; | |
3 | |
4 namespace BLToolkit.Configuration | |
5 { | |
6 internal abstract class ElementCollectionBase<T>: ConfigurationElementCollection | |
7 where T : ConfigurationElement, new() | |
8 { | |
9 protected override ConfigurationElement CreateNewElement() | |
10 { | |
11 return new T(); | |
12 } | |
13 | |
14 protected abstract object GetElementKey(T element); | |
15 | |
16 protected override sealed object GetElementKey(ConfigurationElement element) | |
17 { | |
18 return GetElementKey((T)element); | |
19 } | |
20 | |
21 public new T this[string name] | |
22 { | |
23 get { return (T)BaseGet(name); } | |
24 } | |
25 | |
26 public T this[int index] | |
27 { | |
28 get { return (T)BaseGet(index); } | |
29 } | |
30 } | |
31 } |