Ejemplo n.º 1
0
        /// <summary>
        /// Handles the AchievementsUnlocked event of the AchievementContext control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="args">
        ///     The <see cref="Strokes.Core.AchievementsUnlockedEventArgs"/> instance containing the event data.
        /// </param>
        private static void AchievementContext_AchievementsUnlocked(object sender, AchievementsUnlockedEventArgs args)
        {
            if (args.Achievements.Any())
            {
                Debug.WriteLine(string.Format("Achievements unlocked: {0}",
                                              string.Join(", ", args.Achievements.Select(a => "[" + a.Name + "]"))));

                AchievementNotificationBox.ShowAchievements(args.Achievements);
            }
        }
Ejemplo n.º 2
0
        private void AchievementContext_AchievementsUnlocked(object sender, AchievementEventArgs args)
        {
            Application.Current.Dispatcher.BeginInvoke(new Action(() => notificationBox.ShowAchievements(args.UnlockedAchievements)));

            foreach (var achievement in args.UnlockedAchievements)
            {
                var currentAchievement = achievement;
                var category           = AchievementsOrdered.FirstOrDefault(c => c.CategoryName == currentAchievement.Category);
                if (category != null)
                {
                    category.Update(currentAchievement);
                }
            }

            RaisePropertyChanged(OrderedAchievementsFieldName);
            RaisePropertyChanged(TotalCompletedFieldName);
            RaisePropertyChanged(PercentageCompletedFieldName);
        }
Ejemplo n.º 3
0
        private static void AchievementContext_AchievementsUnlocked(object sender, AchievementEventArgs args)
        {
            System.Console.WriteLine("Unlocked: " + string.Join(", ", args.UnlockedAchievements.Select(a => a.Name)));

            notificationBox.ShowAchievements(args.UnlockedAchievements);
        }