0
|
1 using System;
|
|
2 using System.Collections.Generic;
|
|
3
|
|
4 namespace BLToolkit.Reflection.Extension
|
|
5 {
|
|
6 public class MemberExtensionCollection : Dictionary<string,MemberExtension>
|
|
7 {
|
|
8 public new MemberExtension this[string memberName]
|
|
9 {
|
|
10 get
|
|
11 {
|
|
12 if (this == _null)
|
|
13 return MemberExtension.Null;
|
|
14
|
|
15 MemberExtension value;
|
|
16
|
|
17 return TryGetValue(memberName, out value) ? value : MemberExtension.Null;
|
|
18 }
|
|
19 }
|
|
20
|
|
21 public void Add(MemberExtension memberInfo)
|
|
22 {
|
|
23 if (this != _null)
|
|
24 Add(memberInfo.Name, memberInfo);
|
|
25 }
|
|
26
|
|
27 private static readonly MemberExtensionCollection _null = new MemberExtensionCollection();
|
|
28 public static MemberExtensionCollection Null
|
|
29 {
|
|
30 get { return _null; }
|
|
31 }
|
|
32 }
|
|
33 }
|