Spring – Rev 1
?pathlinks?
using System.Collections.Generic;
namespace Spring.Utilities.Collections
{
public class IndexedList<T> : List<T>
{
#region Public Enums, Properties and Fields
public T Forward
{
get
{
if (++Top >= Count)
{
--Top;
}
var lastItem = base[Top];
return lastItem;
}
}
public T Back
{
get
{
if (--Top < 0)
{
Top = 0;
}
var lastItem = base[Top];
return lastItem;
}
}
#endregion
#region Private Delegates, Events, Enums, Properties, Indexers and Fields
private int Top { get; set; }
#endregion
#region Public Methods
public new void Add(T combos)
{
base.Add(combos);
Top = Count - 1;
}
#endregion
}
}