Example #1
0
        protected bool ToggleFavourite()
        {
            if (this.currentPlayingVideo != null)
            {
                var fav = dataService.IsFavourite(this.currentPlayingVideo.Parent);
                if (!fav)
                {
                    dataService.AddToFavourite(this.currentPlayingVideo.Parent);
                }
                else
                {
                    dataService.DeleteFromFavourite(this.currentPlayingVideo.Parent);
                }

                if (this.ToggelFavourite != null)
                {
                    this.ToggelFavourite(this, new ToggleFavouriteEventArgs
                    {
                        IsFavourite = !fav,
                        Video       = this.currentPlayingVideo.Parent
                    });
                }
                return(!fav);
            }
            return(false);
        }
Example #2
0
 private void addToFavouriteToolStripMenuItem_Click(object sender, EventArgs e)
 {
     dataService.AddToFavourite(this.data);
     UpdateFavourite();
     if (Favourited != null)
     {
         Favourited(this, new GalleryItemFavouriteEventArgs(this.data, true));
     }
 }