示例#1
0
 /// <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);
     }
 }
示例#2
0
 /// <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;
     }
 }
示例#3
0
 /// <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);
 }