예제 #1
0
 public void ShowConfirmDialog()
 {
     try
     {
         AlertDialog.Builder builder     = new AlertDialog.Builder(this);
         AlertDialog         alertDialog = builder
                                           .SetTitle("提示")
                                           .SetMessage("您是否需要退出考试界面?")
                                           .SetPositiveButton("是", (s, e) =>
         {
             speaker.StopAllSpeak();
             if (ExamContext.IsExaming)
             {
                 Module.StopAsync().ContinueWith((task) =>
                 {
                 });
             }
             Free();
             Finish();
         })
                                           .SetNeutralButton("否", (s, e) =>
         {
             //不保存数据进行返回
         })
                                           .Create();//创建alertDialog对象  
         alertDialog.Show();
     }
     catch (Exception ex)
     {
         Logger.Error("SanLianShowConfirmDialog" + ex.Message);
     }
 }
예제 #2
0
 /// <summary>
 /// TODO:这个弹出来时黑框 字体又大 很难看 可以考虑优化一下
 /// </summary>
 public void ShowConfirmDialog()
 {
     try
     {
         AlertDialog.Builder builder     = new AlertDialog.Builder(this);
         AlertDialog         alertDialog = builder
                                           .SetTitle("提示")
                                           .SetMessage("您是否需要退出考试界面?")
                                           .SetPositiveButton("是", (s, e) =>
         {
             speaker.StopAllSpeak();
             EndExam();
             Free();
             Finish();
         })
                                           .SetNeutralButton("否", (s, e) =>
         {
             //不保存数据进行返回
             //
         })
                                           .Create();//创建alertDialog对象  
         alertDialog.Show();
     }
     catch (Exception ex)
     {
         Logger.Error(ex, this.GetType().ToString());
     }
 }
예제 #3
0
 public void ShowConfirmDialog()
 {
     try
     {
         AlertDialog.Builder builder     = new AlertDialog.Builder(this);
         AlertDialog         alertDialog = builder
                                           .SetTitle("提示")
                                           .SetMessage("您是否需要退出考试界面?")
                                           .SetPositiveButton("是", (s, e) =>
         {
             //退出考试界面的时候直接当结束考试
             //直接取消所有的语音播报
             speaker.StopAllSpeak();
             if (ExamContext.IsExaming)
             {
                 //调用考试流程进行结束考试
                 //Logger.InfoFormat("ExamContextIsExaming");
                 Module.StopAsync().ContinueWith((task) =>
                 {
                     // Logger.InfoFormat("Module.StopAsync()");
                 });
             }
             Free();
             //Logger.InfoFormat(" Free();");
             Finish();
         })
                                           .SetNeutralButton("否", (s, e) =>
         {
             //不保存数据进行返回
         })
                                           .Create();//创建alertDialog对象  
         alertDialog.Show();
     }
     catch (Exception ex)
     {
         Logger.Error("DuoLunSensorShowConfirmDialog" + ex.Message);
     }
 }