private void SkipTooth(int toothNum) { IsListening = false; if (!VoiceMsgBox.Show("Mark tooth " + toothNum + " as skipped?", MsgBoxButtons.YesNo)) { IsListening = true; return; } IsListening = true; Point curSpot = new Point(_curCell.X, _curCell.Y); bool radioRightChecked = ((RadioButton)_formPerio.Controls.Find("radioRight", true)[0]).Checked; if (Assembly.GetAssembly(typeof(FormPerio)).GetName().Version >= new Version(16, 4)) { //_gridP.SaveCurExam(_perioExam); MethodInfo method = _gridP.GetType().GetMethod(nameof(ContrPerio.SaveCurExam), BindingFlags.Public | BindingFlags.Instance); method.Invoke(_gridP, new object[] { _perioExam }); } else //16.3 //_gridP.SaveCurExam(_perioExam.PerioExamNum); { MethodInfo method = _gridP.GetType().GetMethod(nameof(ContrPerio.SaveCurExam), BindingFlags.Public | BindingFlags.Instance); method.Invoke(_gridP, new object[] { _perioExam.PerioExamNum }); } int selectedExam = _selectedExam; List <int> listSkippedTeeth = new List <int>(); //int 1-32 if (PerioExams.ListExams.Count > 0) { //set skipped teeth based on the last exam in the list: listSkippedTeeth = PerioMeasures.GetSkipped(PerioExams.ListExams[PerioExams.ListExams.Count - 1].PerioExamNum); } if (!listSkippedTeeth.Contains(toothNum)) { listSkippedTeeth.Add(toothNum); } PerioMeasures.SetSkipped(_perioExam.PerioExamNum, listSkippedTeeth); MethodInfo dynMethod = _formPerio.GetType().GetMethod("RefreshListExams", BindingFlags.NonPublic | BindingFlags.Instance); dynMethod.Invoke(_formPerio, new object[] { }); ((ListBox)_formPerio.Controls.Find("listExams", true)[0]).SelectedIndex = selectedExam; dynMethod = _formPerio.GetType().GetMethod("FillGrid", BindingFlags.NonPublic | BindingFlags.Instance); dynMethod.Invoke(_formPerio, new object[] { }); _curCell = curSpot; if (radioRightChecked) { ClickAdvanceRight(); } //else it will be left by default if (_curLocation.ToothNum == toothNum) //Skipping the current tooth { AdvanceToNextTooth(); } }
///<summary>Displays a message box with the text and reads the text aloud. The user can respond by clicking buttons or answering by voice.</summary> public static bool Show(string text, MsgBoxButtons buttons) { VoiceMsgBox voiceBox = new VoiceMsgBox(); voiceBox._formMsgBox = new FormMsgBox(text, buttons); VoiceMsgBoxSpeech voiceBoxSpeech = new VoiceMsgBoxSpeech(voiceBox._formMsgBox); voiceBoxSpeech.SayText(); voiceBox._formMsgBox.ShowDialog(); voiceBoxSpeech.Dispose(); if (voiceBox._formMsgBox.DialogResult == DialogResult.OK) { return(true); } return(false); }