public static Enumeracion GetInstance() { if (instance == null) { instance = new Enumeracion(); } return(instance); }
internal int SeleccionarOpcion() { int opcion = 0; bool respValida; do { MostrarOpciones(); respValida = true; try { opcion = Convert.ToInt32(Console.ReadLine()); } catch (Exception) { respValida = false; } if (respValida) { if (opcion > Enumeracion.GetInstance().OpcionesCount()) { respValida = false; } } if (!respValida) { Console.Write("EL VALOR INGRESADO NO CORRESPONDE A UNA OPCION VALIDA..."); Console.ReadKey(); Console.Clear(); } } while (!respValida); return(opcion - 1); }