Пример #1
0
        private void Timer_Elapsed(object sender, ElapsedEventArgs e)
        {
            try
            {
                if (_Jobs == null)
                {
                    return;
                }

                _Timer.Stop();

                foreach (TimerJob Event in _Jobs.Jobs)
                {
                    try { Event.Execute(this, _LastTime, e.SignalTime, Error); }
                    catch (Exception ex) { OnError(DateTime.Now, Event, ex); }
                }
            }
            catch (Exception ex)
            {
                OnError(DateTime.Now, null, ex);
            }
            finally
            {
                if (_StopFlag == false)
                {
                    QueueNextTime(e.SignalTime);
                }
            }
        }
Пример #2
0
        private void CheckNetworkStatus(object sender, EventArgs e)
        {
            _networkStatusTimer.Stop();

            if (!CheckInternetConnection())
            {
                _isPreviousNetworkStateFailed = true;
                FirebaseNotificationsService.IsNetworkAvailable = false;
                MessagingCenter.Send(CurrentUiApp.MainPage as MainPage, MessagingCenterConstants.ConnectionRefusedKey);
            }
            else
            {
                if (_isPreviousNetworkStateFailed)
                {
                    _isPreviousNetworkStateFailed = false;
                    FirebaseNotificationsService.IsNetworkAvailable = true;
                    MessagingCenter.Send(CurrentUiApp.MainPage as MainPage, MessagingCenterConstants.ConnectionResumedKey);
                }
            }

            _networkStatusTimer.Start();
        }
Пример #3
0
 public void Stop() => _timer.Stop();