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); }
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; }
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(); } }
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(); } }
void miAuto_AvanceKm(object sender, AutoEventArgs e) { pgbRecorrido.Value = (int)sender; }