示例#1
0
 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);
         }
     }
 }
示例#2
0
 public void SelectBook(Book sBook)
 {
     if (books.Contains(sBook) == true)
     {
         selectedBook = sBook;
         SelectedBookChanged(selectedBook);
     }
 }
示例#3
0
 void library_SelectedBookChanged(Book selectedBook)
 {
     // code to change the selected book
     throw new NotImplementedException();
 }