/// <summary> /// Add a slave control that will always autmatically reflect the state of this /// control, until removed with RemoveSlave(). /// </summary> /// <param name="slave">Slave control to add</param> public void AddSlave(TrafficLightControl slave) { if (slave != null) { _SlaveLights.Add(slave); UpdateExternalControl(slave); } }
/// <summary> /// Update an external control to reflect the state of this control /// </summary> /// <param name="slave">Control to update</param> public void UpdateExternalControl(TrafficLightControl slave) { if (slave != null) { slave.State = _State; slave.Message = GetMessage(); slave.BlinkRate = _blinkRate; } }
/// <summary> /// Remove an existing slaved control /// </summary> /// <param name="slave">Control to remove as a slave to this control</param> public void RemoveSlave(TrafficLightControl slave) { _SlaveLights.Remove(slave); }