public async Task RunCarAsync() { var message = $"Running {_car.GetType().Name} with {_key.GetType().Name} - {_car.Run()} Mile"; var dialog = new MessageDialog(message); _ = await dialog.ShowAsync(); }
public void RunCar() { string carName = _car.GetType().Name; string keyName = _key.GetType().Name; int mileage = _car.Run(); Console.WriteLine($"Running {carName} with {keyName} - {mileage} miles"); }
public async Task RunCarAsync() { var message = $"Running {_car1?.GetType().Name} with {_carKey1.GetType().Name} - {_car1?.Run()} Mile"; message += $"\n\rRunning {_car2?.GetType().Name} with {_carKey2.GetType().Name} - {_car2?.Run()} Mile"; var dialog = new MessageDialog(message); _ = await dialog.ShowAsync(); }
public void RunCar() { if (_key == null) { Console.WriteLine($"Running {_car.GetType().Name} - {_car.Run()} mile"); } else { Console.WriteLine($"Running {_car.GetType().Name} with {_key.GetType().Name} - {_car.Run()} mile"); } }
public void RunCar() { Console.WriteLine("Running {0} with {1} - {2} mile ", _car.GetType().Name, _key.GetType().Name, _car.Run()); }
public void RunCar() { Console.WriteLine("Running {0} with {1} - {2} mile driven by {3} ", _Car.GetType().Name, _Key.GetType().Name, _Car.Run(), _Name); }
public void RunCar() { Console.WriteLine("{0} is running {1} with {2} - {3} mile", _name, _car.GetType().Name, _key.GetType().Name, _car.Run()); }
public Driver(ICar car, ICarKey key) { _car = car; _key = key; RunCar = () => Console.WriteLine($"Running {_car.GetType().Name} with {_key.GetType().Name} - {_car.Run()} kilometer "); }