public BookLibrary(string filename) { books = new ArrayList(); StreamReader file = new StreamReader(filename); string line = ""; using (file) { while (true) { line = file.ReadLine(); if (line == null) { break; } Book newBook = new Book(line); books.Add(newBook); } } }
public void SelectBook(Book sBook) { if (books.Contains(sBook) == true) { selectedBook = sBook; SelectedBookChanged(selectedBook); } }
void library_SelectedBookChanged(Book selectedBook) { // code to change the selected book throw new NotImplementedException(); }