public DecoratorForm(IWattCalculator d) { InitializeComponent(); decorator = d; switcher = 0; FillForm(); }
private void btnAdd_Click(object sender, EventArgs e) { switch (switcher) { case 0: decorator = new Buzzer(decorator); break; case 1: decorator = new LED(decorator); break; case 2: decorator = new Resistor(decorator); break; case 3: decorator = new RGBLED(decorator); break; } lbItems.Items.Add(lbOptions.SelectedItem); }
public Resistor(IWattCalculator m) { decoratedMeasurer = m; }
public RGBLED(IWattCalculator m) { decoratedMeasurer = m; }
public Buzzer(IWattCalculator m) { decoratedMeasurer = m; }