private string SetAppliancePower(PowerState powerState, IAppliance appliance)
 {
     if(powerState == PowerState.Off)
     {
         return appliance.TurnOff();
     }
     else
     {
         return appliance.TurnOn();
     }
 }
 public void AddAppliance(IAppliance appliance)
 {
     _appliances.Add(appliance);
 }
 public LeverSwitch(IAppliance appliance)
     : base(appliance)
 {
 }
Exemple #4
0
 protected ToggleSwitch(IAppliance appliance)
 {
     Appliance = appliance;
 }
 public PullChainSwitch(IAppliance appliance)
     : base(appliance)
 {
 }
Exemple #6
0
 public RemoteControl(IAppliance i)
 {
     this.appliance = i;
 }
Exemple #7
0
 public void TurnOnAppliance(IAppliance appliance)
 {
     appliance.TurnOn();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="TurnOnOffCommand"/> class.
 /// </summary>
 /// <param name="appliance">The appliance.</param>
 public TurnOnOffCommand(IAppliance appliance)
 {
     Appliance = appliance;
 }
Exemple #9
0
 public Worker(ILogger <Worker> logger, IAppliance appliance)
 {
     _logger    = logger;
     _appliance = appliance;
 }