private void MbedServiceOnMbedStatusChanged(object sender, MbedStatusEventArgs mbedStatusEventArgs) { switch (mbedStatusEventArgs.Status) { case MbedStatus.Connected: OnCarControllerStatusChanged(CarControllerStatus.Connected); break; case MbedStatus.Disconnected: case MbedStatus.Error: OnCarControllerStatusChanged(CarControllerStatus.Disconnected); Stop(); break; } }
public void OnMbedStatusChanged(MbedStatusEventArgs e) { EventHandler<MbedStatusEventArgs> handler = MbedStatusChanged; if (handler != null) handler(this, e); }
public void OnMbedStatusChanged(MbedStatus status) { Status = status; MbedStatusEventArgs e = new MbedStatusEventArgs {Status = status}; EventHandler<MbedStatusEventArgs> handler = MbedStatusChanged; if (handler != null) handler(this, e); }