private void HandleSendingSuccessfulState(ServerCommEventArgs e) { if (e == null || !e.HasData) { HandleSendingFailedStatus(); return; } CurrentData = e.Data; ChangeStatusText(Resources.GetString(Resource.String.SendingSuccessful)); ShowOverlay(); StorageService.StoreData(CurrentData); }
private void HandleSendingSuccessfulState(ServerCommEventArgs e) { ChangeOverlayStatusText(Resources.GetString(Resource.String.SendingSuccessful)); HideOverlay(); if (!IsInAnalyzer) return; if (!e.HasData) { HandleSendingFailedStatus(); return; } CurrentData = e.Data; StorageService.StoreData(CurrentData); }
private void OnServerCommChanged(object s, ServerCommEventArgs e) { switch (e.Status) { case ServerStatus.NetworkConnected: HandleNetworkConnectedStatus(); Log.Debug(Tag, Resources.GetString(Resource.String.NetworkConnected)); break; case ServerStatus.NoNetworkConnection: HandleNoNetworkConnectedStatus(); Log.Debug(Tag, Resources.GetString(Resource.String.NoNetworkConnection)); break; case ServerStatus.Starting: HandleServerCommServiceStartingStatus(); Log.Debug(Tag, Resources.GetString(Resource.String.StartingServerCommService)); break; case ServerStatus.NoServerConnection: HandleNoServcerConnectionStatus(); Log.Debug(Tag, Resources.GetString(Resource.String.NoServerConnection)); break; case ServerStatus.WaitingForResponse: HandleWaitingForResponseStatus(); Log.Debug(Tag, Resources.GetString(Resource.String.WaitingForResponse)); break; case ServerStatus.SendingSuccessful: HandleSendingSuccessfulState(e); Log.Debug(Tag, Resources.GetString(Resource.String.SendingSuccessful)); break; case ServerStatus.SendingFailed: HandleSendingFailedStatus(); Log.Debug(Tag, Resources.GetString(Resource.String.SendingFailed)); break; case ServerStatus.Stopped: HandleServerCommServiceStoppedStatus(); Log.Debug(Tag, Resources.GetString(Resource.String.ServerCommServiceStopped)); break; default: throw new ArgumentOutOfRangeException(); } }
private void OnCommunication(object s, ServerCommEventArgs e) { var handler = Communication; if (handler != null) handler(s, e); }