コード例 #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);
            }
        }
コード例 #2
0
        private void AchievementContext_AchievementsUnlocked(object sender, AchievementsUnlockedEventArgs args)
        {
            foreach (var achievement in args.Achievements)
            {
                var category = AchievementsOrdered.FirstOrDefault(c => c.CategoryName == achievement.Category);
                if (category != null)
                {
                    category.Update(achievement);
                }
            }

            RaisePropertyChanged(OrderedAchievementsFieldName);
            RaisePropertyChanged(TotalCompletedFieldName);
            RaisePropertyChanged(PercentageCompletedFieldName);
        }
コード例 #3
0
 private static void AchievementContext_AchievementsUnlocked(object sender, AchievementsUnlockedEventArgs args)
 {
     System.Console.WriteLine("Unlocked: " + string.Join(", ", args.Achievements.Select(a => a.Name)));
 }