예제 #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);
            }
        }
예제 #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;
			}
		}
예제 #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;
			}
		}
예제 #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);
		}
예제 #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;
			}
		}