예제 #1
0
 public void Unplug()
 {
     if (_device == null)
     {
         Console.WriteLine("There are no devices plugged in.");
     }
     else
     {
         Console.WriteLine($"{_device.Name()} unplugged.\n");
         _device = null;
     }
 }
예제 #2
0
 public void PlugIn(ThreePinPlugDevice device)
 {
     if (_device == null)
     {
         _device = device;
         Console.WriteLine($"{device.Name()} plugged in.");
     }
     else
     {
         Console.WriteLine($"Unable to plug {device.Name()} in, {_device.Name()} already plugged in.");
     }
 }