private Knob Knob(string letter, int index = 0) { Knob found = null; int count = 0; knobs.ForEach(knob => { if (knob.Text() == letter) { if (count == index) { found = knob; } count++; } }); if (found == null) { throw new InvalidOperationException("not a named knob: " + letter); } return(found); }
private void ReleaseAllKnobs() { knobs.ForEach(knob => { Leave(knob); }); }