private void ListLibraryBooks_SelectedIndexChanged(object sender, EventArgs e) { if (mode != 0) { mode = 0; TransferBooks.Clear(); StringsToSearch.Clear(); } if (ListLibraryBooks.SelectedIndex != -1) { Book book = library.GetBookByIndex(ListLibraryBooks.SelectedIndex); if (book != null && !TransferBooks.Contains(book)) { TransferBooks.Add(book); TransferBooksList.Items.Add(book.Name + " " + book.Author); } } RefreshForm(); }