Spring – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 using System.Collections.Generic;
2  
3 namespace Spring.Utilities.Collections
4 {
5 public class IndexedList<T> : List<T>
6 {
7 #region Public Enums, Properties and Fields
8  
9 public T Forward
10 {
11 get
12 {
13 if (++Top >= Count)
14 {
15 --Top;
16 }
17  
18 var lastItem = base[Top];
19  
20 return lastItem;
21 }
22 }
23  
24 public T Back
25 {
26 get
27 {
28 if (--Top < 0)
29 {
30 Top = 0;
31 }
32  
33 var lastItem = base[Top];
34  
35 return lastItem;
36 }
37 }
38  
39 #endregion
40  
41 #region Private Delegates, Events, Enums, Properties, Indexers and Fields
42  
43 private int Top { get; set; }
44  
45 #endregion
46  
47 #region Public Methods
48  
49 public new void Add(T combos)
50 {
51 base.Add(combos);
52  
53 Top = Count - 1;
54 }
55  
56 #endregion
57 }
58 }