comparison Source/Reflection/Extension/AttributeExtensionCollection.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.Collections.Generic;
3
4 namespace BLToolkit.Reflection.Extension
5 {
6 public class AttributeExtensionCollection : List<AttributeExtension>
7 {
8 public new AttributeExtension this[int index]
9 {
10 get
11 {
12 return this == _null || index < 0 || index >= Count ? AttributeExtension.Null : base[index];
13 }
14 }
15
16 public object Value
17 {
18 get { return this == _null? null: this[0].Value; }
19 }
20
21 public new void Add(AttributeExtension attributeExtension)
22 {
23 if (this != _null)
24 base.Add(attributeExtension);
25 }
26
27 private static readonly AttributeExtensionCollection _null = new AttributeExtensionCollection();
28 public static AttributeExtensionCollection Null
29 {
30 get { return _null; }
31 }
32 }
33 }