Exemplo n.º 1
0
        /// <summary>
        /// Add favorite
        /// </summary>
        /// <param name="fav">fav</param>
        /// <returns>True = success/False = fail</returns>
        public Task <bool> AddFavorite(Favorite fav, CancellationToken cancellationToken = default(CancellationToken))
        {
            try
            {
                // Exists.
                if (Favorites.Contains(fav))
                {
                    return(Task.FromResult(false));
                }
                Favorites.Add(fav);

                return(CheckFavorites(cancellationToken).ContinueWith(x =>
                {
                    return true;
                }));
            }
            catch
            {
                return(Task.FromResult(false));
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Remvoe favorite
 /// </summary>
 /// <param name="fav"></param>
 public void RemoveFavorite(Favorite fav)
 {
     Favorites.Remove(fav);
 }