Ejemplo n.º 1
0
        void _favouriteButton_Click(object sender, EventArgs e)
        {
            isFavorite = !isFavorite;

            if (isFavorite) {
                favoriteButton.SetBackgroundResource(Resource.Drawable.star_gold_selector);
                var fav = new Favorite { SessionID = session.ID, SessionKey = session.Key };
                BL.Managers.FavoritesManager.AddFavoriteSession(fav);
            } else {
                favoriteButton.SetBackgroundResource(Resource.Drawable.star_grey_selector);
                BL.Managers.FavoritesManager.RemoveFavoriteSession(session.Key);
            }
        }
Ejemplo n.º 2
0
		bool ToggleFavorite ()
		{
			if (FavoritesManager.IsFavorite (session.Key)) {
				FavoritesManager.RemoveFavoriteSession (session.Key);
				return false;
			} else {
				var fav = new Favorite {SessionID = session.ID, SessionKey = session.Key};
				FavoritesManager.AddFavoriteSession (fav);
				return true;
			}
		}
Ejemplo n.º 3
0
		bool ToggleFavorite ()
		{
#warning This should really be session.FavoriteSessionsCommand.Execute();
            if (FavoritesManager.IsFavorite(session.SessionKey))
            {
                FavoritesManager.RemoveFavoriteSession(session.SessionKey);
				return false;
			} else {
                var fav = new Favorite { SessionID = session.ID, SessionKey = session.SessionKey };
				FavoritesManager.AddFavoriteSession (fav);
				return true;
			}
		}
Ejemplo n.º 4
0
		// API for managing favorites is via SessionName
		// since Session.ID might not survive data updates
		// (to be confirmed, adapt if required)

		public static int SaveFavorite (Favorite favorite)
		{
            //var fav = new Favorite { SessionKey = sessionKey };
            return DL.MwcDatabase.SaveItem<Favorite>(favorite);
		}
Ejemplo n.º 5
0
		bool ToggleFavorite ()
		{
			if (FavoritesManager.IsFavorite (session.Key)) {
				FavoriteButton.SetImage (new UIImage(AppDelegate.ImageNotFavorite), UIControlState.Normal);
				FavoritesManager.RemoveFavoriteSession (session.Key);
				return false;
			} else {
				FavoriteButton.SetImage (new UIImage(AppDelegate.ImageIsFavorite), UIControlState.Normal);
				var fav = new Favorite{SessionID = session.ID, SessionKey = session.Key};
				FavoritesManager.AddFavoriteSession (fav);
				return true;
			}
		}