private void askForChoice(StringBuilder i_Error) { int choice; while (!int.TryParse(Console.ReadLine(), out choice) || choice > r_ItemList.Count || choice < 0) { Console.Clear(); Console.Write(i_Error); } if (choice == 0) { if (Father != null) { Father.OnOptionChosen(); } else { return; } } else { r_ItemList[choice - 1].OnOptionChosen(); } }
internal override void OnOptionChosen() { if (OptionChosen != null) { Console.Clear(); OptionChosen.Invoke(); } System.Threading.Thread.Sleep(k_TimeOutPeriod); Father.OnOptionChosen(); }