static void Main(string[] args) { NotePad nt = new NotePad(20); nt.Add(new Note("ivan", "ivanov", new DateTime(2010, 10, 5), 12345, "ivan@mail")); nt.Add(new Note("petr", "ivanov", new DateTime(2010, 10, 5), 12345, "ivan@mail")); nt.Add(new Note("ivan", "petrov", new DateTime(2010, 10, 5), 12345, "ivan@mail")); nt.Add(new Note("ivan", "ivanov", new DateTime(2010, 10, 5), 12345, "ivan@mail")); foreach (Note note in nt) { if (note != null) { Console.WriteLine(note.ToString()); } else { break; } } nt.SearchByFirstName("ivan"); }