public virtual void OnLightStatusChange(LightStatus status) { if (LightStatusChanged == null) { return; } LightEventArgs arg = new LightEventArgs(status); LightStatusChanged(this, arg); }
/// <summary> /// 照明灯开关控制 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void rtuControl1_LightStatusChanged(object sender, LightEventArgs e) { if (_measApp != null && _measApp.Rtu != null) { switch (e.Value) { case LightStatus.Closed: _measApp.Rtu.CloseLight(); break; case LightStatus.Open: _measApp.Rtu.OpenLight(); break; } } }
public virtual void OnLightStatusChange(LightStatus status) { if (LightStatusChanged == null) return; LightEventArgs arg = new LightEventArgs(status); LightStatusChanged(this, arg); }