static void Main(string[] args) { ChainedListItem <int> chainedList = new ChainedListItem <int>(); chainedList.Add(1).Add(2).Add(3); chainedList.Dump(); }
public void Dump() { ChainedListItem <T> current = this; while ((current = current.NextItem) != null) { Console.WriteLine(current._content); } }
public ChainedListItem <T> Add(T content) { _nextItem = new ChainedListItem <T>(); _nextItem.Content = content; return(_nextItem); }