Пример #1
0
        public void CheckByHours()
        {
            //循环检测购买的小时数
            bool isBuy = false;

            while (!IsStopCheck)
            {
                if (!DataBase.CanUse())
                {
                    //延迟30毫秒
                    Thread.Sleep(60 * 1000);
                    bool IsBuy = Tools.BuyMinute() > 0;
                    if (IsBuy)
                    {
                        DataBase.ByMinute = Tools.BuyMinute();
                        DataBase.ByTimes  = DateTime.Now;
                        speaker.SpeakAsync("目前还剩余{0}" + DataBase.ByMinute.ToString() + "分钟");
                        break;
                    }
                }
            }
            alertDialog.Dismiss();
            if (DataBase.CanUse())
            {
                Intent intent = new Intent();
                intent.SetClass(this, GetActivityType());
                intent.PutExtra("ExamMode", "Exam");
                StartActivity(intent);
                IsStopCheck = true;
            }

            //如果当前设备不可用
        }
Пример #2
0
 private void FormInterpretationAlgorithm(Form form)
 {
     _currentForm = form;
     if (form.Field != null)
     {
         _speaker.SpeakAsync(form.Field.Prompt.Message);
     }
     else
     {
         if (form.Id.Equals("GoodEnd"))
         {
             CalculateThePrice();
             _mainWindow.SetLabels(_order);
             DatabaseRepository.AddOrder(_order);
             _speaker.Speak(form.Block.Prompt.Message);
             Environment.Exit(0);
         }
         if (form.Id.Equals("Reset"))
         {
             ResetOrder();
         }
     }
 }