static void Main(string[] args) { Library library = new Library(); StudentFantast stFantast = new StudentFantast(); StudentComputerScientist stCompScientist = new StudentComputerScientist(); library.registerStudent(stFantast); library.registerStudent(stCompScientist); library.AddBook(new Book("The Lord of the rings", "Peter Jackson", "fantasy")); library.AddBook(new Book("Modern operating systems", "Andrew Tanenbaum", "computer science")); library.AddBook(new Book("Triumphal arch", "Erich Maria Remarque", "war novel")); Book book1 = new Book("The computer science", "The author", "computer science"); library.AddBook(book1); try { library.TakeBook(book1); } catch (ArgumentException) { } foreach (Book book in library) { Console.WriteLine(book.BookName); } Console.ReadKey(); }
public void NewBookComputerLiterature(Book book) { if (book.Genre == "ComputerLiterature") { Console.WriteLine("В библиотеку пришла комп.литер.Первый студент отправился за Комп.Литертурой"); } }
public void RemoveBook(Book book) { _books.Remove(book); removeBook(book); NotifyCollectionChangedEventArgs Args = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, book); CollectionChanged(this, Args); }
public void NewBookFantastik(Book book) { if (book.Genre == "Fantastic") { Console.WriteLine("В библиотеку пришла фант. литер.Второй студент отправился за Комп.Литертурой"); } }
public void AddBook(Book book) { _library.Add(book); if (BookAdded != null) { BookAdded(this, new BookChangeEventArgs(book)); } }
public void AddBook(Book book) { _books.Add(book); addBook(book); NotifyCollectionChangedEventArgs Args = new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add,book); CollectionChanged(this,Args); }
public void RemovedBookFromLibrary(Book book) { if (book.Genre != "Fantastic") { Console.WriteLine("Я не собирался идти за этой книгой"); } }
public void NewBookFantastik(Book book) { if (book.Genre == "Fantastic") { Console.WriteLine("LIBRARY HAVE NEW Fantastik"); } }
public Book TakeBook(Book book) { if (!_library.Contains(book)) { throw new ArgumentException("There is no book with such name in the library"); } _library.Remove(book); return book; }
public void NewBookComputerLiterature(Book book) { if (book.Genre == "ComputerLiterature") { Console.WriteLine("LIBRARY HAVE NEW ComputerLiterature"); } }
public void AddBook(Book book) { if(book == null) { throw new ArgumentNullException(); } else { _books.Add(book); OnBookAdded(new LibEventArgs(book.Title, book.Genre)); } }
public Book TakeBook(Book book) { if (!_library.Contains(book)) { throw new ArgumentException("There is no book with such name in the library"); } if (BookAdded != null) { BookTaken(this, new BookChangeEventArgs(book)); _library.Remove(book); } return book; }
public void RemoveBook(Book book) { lst.Remove(book); removeBook(book); }
public void AddBook(Book book) { lst.Add(book); addBook(book); }
public void AddBook(Book book) { _library.Add(book); }
public BookChangeEventArgs(Book book) { _book = book; }