public void submitLightRequest(Light light) { this.light = light; LightForm form = new LightForm(this); form.ShowDialog(); }
public void executeRequest(LightRequest request) { if (request.BrightnessValue < 0) { if (displayConfirmation("Error: Brightness must be a positive integer.")) { LightForm form = new LightForm(this); form.ShowDialog(); } return; } if (request.BrightnessValue == 0) { light.Status = false; light.OnTime = request.OnTime; light.OffTime = request.OffTime; light.Brightness = 0; } else { light.Status = true; light.OnTime = request.OnTime; light.OffTime = request.OffTime; light.Brightness = request.BrightnessValue; } displayConfirmation("Light successfuly changed."); }
public LightController(Light light) { this.light = light; LightForm form = new LightForm(this); form.ShowDialog(); }
private void ShowLightForm() { LightForm lightForm = new LightForm(this.light); lightForm.ShowDialog(this); }