Exemple #1
0
        // Код для выполнения при активации приложения (переводится в основной режим)
        // Этот код не будет выполняться при первом запуске приложения
        private void Application_Activated(object sender, ActivatedEventArgs e)
        {
            ListItems.Load();
            if (e.IsApplicationInstancePreserved)
            {
                return;
            }

            IsolatedStorageSettings iss = IsolatedStorageSettings.ApplicationSettings;

            if (PhoneApplicationService.Current.State.ContainsKey("Settings"))
            {
                Settings = PhoneApplicationService.Current.State["Settings"] as SettingsData;
            }
            else
            {
                if (!iss.TryGetValue("Settings", out settingsData))
                {
                    Settings = new SettingsData();
                }
            }

            Mogade = MogadeHelper.CreateInstance();
#if !DEBUG
            Mogade.LogApplicationStart();
#endif
        }
 private void LoadLeaderboard()
 {
     _performanceProgressBar.IsIndeterminate = true;
     //ScopeTitle.Text = _scope.ToString();
     //we can avoid the cross-thread issue by dispatching the entire callback, but don't do too much!
     Mogade.GetLeaderboard(MogadeHelper.LeaderboardId(Leaderboards.Main), _scope, _page, 50, r => Dispatcher.BeginInvoke(() => LeaderboardReceived(r)));
     //could put a loading message here
 }
Exemple #3
0
        // Код для выполнения при запуске приложения (например, из меню "Пуск")
        // Этот код не будет выполняться при повторной активации приложения
        private void Application_Launching(object sender, LaunchingEventArgs e)
        {
            ListItems.Load();
            IsolatedStorageSettings iss = IsolatedStorageSettings.ApplicationSettings;

            if (!iss.TryGetValue("Settings", out settingsData))
            {
                Settings = new SettingsData();
            }


            Mogade = MogadeHelper.CreateInstance();
#if !DEBUG
            Mogade.LogApplicationStart();
#endif
        }
Exemple #4
0
        private void Submit_Click(object sender, RoutedEventArgs e)
        {
            Settings.Player1Name = UserName.Text;

            if (string.IsNullOrEmpty(UserName.Text))
            {
                return;
            }
            Submit.IsEnabled = false;
            Submit.Content   = "Sending...";

            //we can store a bit of arbitrary data in the Data field which we can then use in our leaderboard
            //you can always not set the Data if you have no extra information you want to store with the score
            var score = new Score {
                Points = _score, UserName = UserName.Text
            };

            Mogade.SaveScore(MogadeHelper.LeaderboardId(Leaderboards.Main), score, ScoreResponseHandler);
        }