示例#1
0
        private void ManejadorEmpty(object sender, AutoEventArgs e)
        {
            this.MostrarAuto();
            this.txtCombustible.BackColor = Color.Red;

            MessageBox.Show("Quedan " + e.CombustibleEnElTanque + " Litros", "Sin Combustible", MessageBoxButtons.OK, MessageBoxIcon.Stop);
        }
示例#2
0
        static void ManejadorEmpty(object sender, AutoEventArgs e)
        {
            Console.ForegroundColor = ConsoleColor.Red;

            Console.WriteLine("Soy el " + ((Auto)sender).Marca + " y me quede sin combustible.");

            Console.ForegroundColor = ConsoleColor.Gray;
        }
示例#3
0
        private void ManejadorReserva(object sender, AutoEventArgs e)
        {
            this.MostrarAuto();
            this.txtCombustible.BackColor = Color.Yellow;

            if (MessageBox.Show("LLenar el tanque? ", "Reserva de Combustible", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK)
            {
                this.CargarCombustible();
            }
        }
示例#4
0
        static void ManejadorReserva(object sender, AutoEventArgs e)
        {
            String llenar;

            Console.ForegroundColor = ConsoleColor.Yellow;

            Console.WriteLine("Soy el " + ((Auto)sender).Marca + " y estoy con la reserva, solo quedan {0} litros de combustible.", e.CombustibleEnElTanque);

            Console.ForegroundColor = ConsoleColor.White;

            Console.Write("Desea Llenar el tanque? S/N: ");

            Console.ForegroundColor = ConsoleColor.Gray;
            llenar = Console.ReadLine();
            Console.WriteLine();

            if (String.Compare(llenar, "s") == 0)
            {
                ((Auto)sender).LlenarTanque();
            }
        }
示例#5
0
 void miAuto_AvanceKm(object sender, AutoEventArgs e)
 {
     pgbRecorrido.Value = (int)sender;
 }