static void Main() { ShowHelp(); RecentCollection <int> list = new RecentCollection <int>(5); bool shownFullMessage = false; for (;;) { Console.WriteLine("Введите число. Для выхода введите пустую строку."); Console.Write("> "); string line = Console.ReadLine(); if (string.IsNullOrWhiteSpace(line)) { break; } int num; if (!int.TryParse(line, out num)) { continue; } list.Add(num); if (list.IsFull && !shownFullMessage) { ShowFullMessage(); shownFullMessage = true; } int[] numbers = list.ToArray(); Console.WriteLine("{{ {0} }}", string.Join(", ", numbers)); Console.WriteLine(); } }
internal RecentCollectionEnumerator(RecentCollection <T> list) { this.list = list; version = list.version; index = 0; current = default(T); }
public MainForm() { InitializeComponent(); recentFiles = new RecentCollection <string>(10); }
public void Dispose() { list = null; current = default(T); }