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();
        }
Esempio n. 2
0
        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();
        }
Esempio n. 4
0
 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");
     }
 }
Esempio n. 5
0
 public void RunCar()
 {
     Console.WriteLine("Running {0} with {1} - {2} mile ", _car.GetType().Name, _key.GetType().Name, _car.Run());
 }
Esempio n. 6
0
 public void RunCar()
 {
     Console.WriteLine("Running {0} with {1} - {2} mile driven by {3} ", _Car.GetType().Name, _Key.GetType().Name, _Car.Run(), _Name);
 }
Esempio n. 7
0
 public void RunCar()
 {
     Console.WriteLine("{0} is running {1} with {2} - {3} mile", _name, _car.GetType().Name, _key.GetType().Name, _car.Run());
 }
Esempio n. 8
0
 public Driver(ICar car, ICarKey key)
 {
     _car   = car;
     _key   = key;
     RunCar = () => Console.WriteLine($"Running {_car.GetType().Name} with {_key.GetType().Name} - {_car.Run()} kilometer ");
 }