Esempio n. 1
0
        private void NextQuestion()
        {
            jokerDisplay.Children.Clear();
            var quest = LevelPlayViewModel.GetNextQuestion();

            lblInfo.Text = ActualQuest;
            if (quest == null)
            {
                var lvl = LevelPlayViewModel.LevelViewModel.Levels.Where(x => x.IdLevel == LevelPlayViewModel.Level.IdLevel + 1).FirstOrDefault();
                if (lvl != null)
                {
                    lvl.IsLocked = false;
                }
                LevelPlayViewModel.WriteLevelDone(LevelPlayViewModel.Level.Questions, LevelPlayViewModel.Level.IdLevel, LevelPlayViewModel.MaxLevelId);

                IsBusy             = true;
                Maingrid.IsEnabled = false;
                adIntersticial.LoadAd();
                //write to DB
            }
            else
            {
                LblQuestion.Text        = LevelPlayViewModel.GetActualQuestion().QuestionText;
                actualOptions           = LevelPlayViewModel.GetActualQuestion().Options.OrderBy((item) => _rnd.Next()).ToList();
                listOptions.ItemsSource = actualOptions;
            }
        }
Esempio n. 2
0
        public void OnRewardedVideoAdFailedToLoad(int errorCode)
        {
            switch (errorCode)
            {
            //ERROR_CODE_INTERNAL_ERROR => Something happened internally; for instance, an invalid response was received from the ad server.
            case 0: adIntersticial.LoadAd(); break;     //ShowErrorMessage("Internal error"); break;

            //ERROR_CODE_INVALID_REQUEST => The ad request was invalid; for instance, the ad unit ID was incorrect.
            case 1: adIntersticial.LoadAd(); break;     //ShowErrorMessage("Neplatné ID"); break;

            //ERROR_CODE_NETWORK_ERROR => The ad request was unsuccessful due to network connectivity.
            case 2: RewardOK(); break;   // ShowErrorMessage("Nie je pripojenie na internet!"); break;

            //ERROR_CODE_NO_FILL => The ad request was successful, but no ad was returned due to lack of ad inventory. Nie je ziadna reklama od googlu uz...
            case 3: adIntersticial.LoadAd(); break;
            }
        }