private void ShowCopies(DataGridView sender) { Book book = books.FindBook(sender.SelectedRows[0].Cells[1].Value.ToString(), sender.SelectedRows[0].Cells[0].Value.ToString()); CopiesForm copiesForm = new CopiesForm(books.GetBookCopyList(book)); copiesForm.Show(); copiesForm.BookReturn += TakenBooksForm_BookReturn; }
public static void Serialize(StreamWriter writer, BookDictionary dictionary) { List <Pair> entries = new List <Pair>(); foreach (Book key in dictionary.Keys) { entries.Add(new Pair(key, dictionary.GetBookCopyList(key))); } XmlSerializer serializer = new XmlSerializer(typeof(List <Pair>)); serializer.Serialize(writer, entries); }