コード例 #1
0
        /// <summary>
        /// Updates the achievements.
        /// </summary>
        /// <param name="steamUserId">The steam user id.</param>
        /// <returns>true if successful, else false.</returns>
        /// <remarks>jQuery/WCF requires a return value in order for jQuery to execute $.ajax.success.</remarks>
        public int UpdateAchievements(string steamUserId)
        {
            if (steamUserId == null)
            {
                throw new ArgumentNullException("steamUserId");
            }

            IEnumerable <UserAchievement> achievements = _communityService.GetAchievements(steamUserId);

            int updated = _achievementManager.UpdateAchievements(achievements.ToDataAchievements());

            return(updated);
        }
コード例 #2
0
        /// <summary>
        /// Updates the achievements.
        /// </summary>
        /// <param name="json">The json object.</param>
        /// <returns>true if successful, else false.</returns>
        /// <remarks>jQuery/WCF requires a return value in order for jQuery to execute $.ajax.success.</remarks>
        public bool UpdateAchievements(SteamUserIdParameter json)
        {
            if (json == null)
            {
                throw new ArgumentNullException("json");
            }

            IEnumerable <Achievement> achievements = _communityService.GetAchievements(json.SteamUserId);

            _service.UpdateAchievements(json.SteamUserId, achievements);

            return(true);
        }
        /// <summary>
        /// Updates the achievements.
        /// </summary>
        /// <param name="steamUserId">The steam user id.</param>
        /// <returns>true if successful, else false.</returns>
        /// <remarks>jQuery/WCF requires a return value in order for jQuery to execute $.ajax.success.</remarks>
        public bool UpdateAchievements(string steamUserId)
        {
            if (steamUserId == null)
            {
                throw new ArgumentNullException("steamUserId");
            }

            IEnumerable <Achievement> achievements = _communityService.GetAchievements(steamUserId);

            _service.UpdateAchievements(steamUserId, achievements);

            return(true);
        }
        /// <summary>
        /// Updates the achievements.
        /// </summary>
        /// <param name="steamUserId">The steam user id.</param>
        /// <returns>true if successful, else false.</returns>
        /// <remarks>jQuery/WCF requires a return value in order for jQuery to execute $.ajax.success.</remarks>
        public int UpdateAchievements(string steamUserId)
        {
            if (steamUserId == null)
            {
                throw new ArgumentNullException("steamUserId");
            }

            IEnumerable <Achievement> achievements = _communityService.GetAchievements(steamUserId, _service.GetGames());

            int updated = _service.UpdateAchievements(steamUserId, achievements);

            return(updated);
        }
コード例 #5
0
        /// <summary>
        /// Updates the achievements.
        /// </summary>
        /// <param name="steamUserId">The steam user id.</param>
        /// <returns>true if successful, else false.</returns>
        /// <remarks>jQuery/WCF requires a return value in order for jQuery to execute $.ajax.success.</remarks>
        public int UpdateAchievements(string steamUserId)
        {
            if (steamUserId == null)
            {
                throw new ArgumentNullException("steamUserId");
            }

            IEnumerable <Achievement>      achievements        = _communityService.GetAchievements(steamUserId);
            IEnumerable <Data.Achievement> achievementEntities =
                from achievement in achievements
                select new Data.Achievement
            {
                Name        = achievement.Name,
                Description = achievement.Description,
                ImageUrl    = achievement.ImageUrl.ToString(),
                GameId      = achievement.Game.Id
            };

            int updated = _achievementManager.UpdateAchievements(steamUserId, achievementEntities);

            return(updated);
        }