示例#1
0
 private void Main_Load(object sender, EventArgs e)
 {
     pnlConteudo.Controls.Add(new View.UcPesquisa());
     View.UcFavoritos ucFavoritos = new View.UcFavoritos();
     ucFavoritos.Dock = DockStyle.Fill;
     pnlFavoritos.Controls.Add(ucFavoritos);
 }
示例#2
0
 private void btnFavorite_Click(object sender, EventArgs e)
 {
     if (!book.Favorite)
     {
         book.setFavorite();
         UcFavoritos.addToList(new Favorite(
                                   id: book.id,
                                   title: book.volumeInfo.title,
                                   description: book.volumeInfo.title,
                                   thumbnail: book.volumeInfo.imageLinks.thumbnail,
                                   smallThumbnail: book.volumeInfo.imageLinks.smallThumbnail
                                   ));
     }
     else
     {
         book.unsetFavorite();
         UcFavoritos.removeFromList(book.id);
     }
     changeBtnImg();
 }