Exemple #1
0
 public void StopWorker()
 {
     // starting timer
     if (null != _timer)
     {
         _timer.Invalidate();
         _timer.Dispose();
         _timer = null;
     }
 }
Exemple #2
0
        public override void ViewDidDisappear(bool animated)
        {
            base.ViewDidDisappear(animated);

            if (timer != null)
            {
                timer.Invalidate();
                timer.Dispose();
                timer = null;
            }
        }
        protected override void Dispose(bool disposing)
        {
            disposed = true;
            if (beatTimer != null)
            {
                beatTimer.Dispose();
                beatTimer = null;
            }

            base.Dispose(disposing);
        }
Exemple #4
0
 private void StartEventTimer()
 {
     _eventTimer?.Invalidate();
     _eventTimer?.Dispose();
     _eventTimer = null;
     Device.BeginInvokeOnMainThread(() =>
     {
         _eventTimer = NSTimer.CreateScheduledTimer(60, true, timer =>
         {
             var task = Task.Run(() => _eventService.UploadEventsAsync());
         });
     });
 }
 void hack()
 {
     try
     {
         _timer.Dispose();
         updateMeeting();
         _timer = NSTimer.CreateRepeatingScheduledTimer(TimeSpan.FromSeconds(11), hack);
     }
     catch (Exception e)
     {
         //if the semaphore is full, do nothing.
     }
 }
 /// <summary>
 /// Stop the timer.
 /// </summary>
 public void Stop()
 {
     DebugOutput("!!!!! STOPPING TIMER from thread: " + NSThread.Current.Handle + ", MAIN: " + NSThread.MainThread.Handle);
     _timer.Invalidate();
     _timer.Dispose();
     _timer = null;
 }
        protected override void Dispose(bool disposing)
        {
            Logger.Log("UIChaptersEnabledVideoView.Dispose: disposing = " + disposing);

            if (disposing)
            {
                willEnterForegroundNotification?.Dispose();
                willEnterForegroundNotification = null;

                didEnterBackgroundNotification?.Dispose();
                didEnterBackgroundNotification = null;

                playbackDidFinishNotification?.Dispose();
                playbackDidFinishNotification = null;

                playbackIsPreparedToPlayNotification?.Dispose();
                playbackIsPreparedToPlayNotification = null;

                playbackStateDidChangeNotification?.Dispose();
                playbackStateDidChangeNotification = null;

                adSkipTimer?.Dispose();
                adSkipTimer = null;

                if (moviePlayer != null)
                {
                    moviePlayer.MoviePlayer?.Dispose();
                    moviePlayer.Dispose();
                    moviePlayer = null;
                }
            }

            base.Dispose(disposing);
        }
        //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        public override void ViewWillDisappear(bool animated)
        {
            base.ViewWillDisappear(animated);

            timer.Invalidate();
            timer.Dispose();
        }
 public void Reset()
 {
     inactivityTimer.Invalidate();
     inactivityTimer.Dispose();
     inactivityTimer         = NSTimer.CreateScheduledTimer(TimeSpan.FromSeconds(AppConstant.InactivityTimeOut), InActivityTimer_Elapsed);
     lastActivityElapsedTime = NSProcessInfo.ProcessInfo.SystemUptime;
 }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            cupFar  = UIImage.FromFile("bekerVeraf.jpg");
            cupNear = UIImage.FromFile("bekerDichtbij.jpg");
            layer   = UIImage.FromFile("layer_transparent.png");
            empty   = UIImage.FromFile("");

            imvLayer = new UIImageView(UIScreen.MainScreen.Bounds);

            View.Add(imvLayer);

            inActive();

            btnTrigger.TouchUpInside += (sender, e) => {
                imvImageTest.Image = cupNear;
                btnTrigger.Hidden  = true;
                drinken.Dispose();

                //call.Play("thirsty.mp3");


                NSTimer.CreateScheduledTimer(TimeSpan.FromSeconds(5), delegate {
                    imvLayer.Image = layer;

                    NSTimer.CreateScheduledTimer(TimeSpan.FromSeconds(5), delegate {
                        inActive();
                    });
                });
            };
        }
Exemple #11
0
 private void StopTimer()
 {
     if (mTimer != null)
     {
         mTimer.Dispose();
         mTimer = null;
     }
 }
Exemple #12
0
 void DismissMessage(UIAlertController alert, NSTimer alertDelay, Action complete)
 {
     alert?.DismissViewController(true, complete);
     alert?.Dispose();
     alertDelay?.Dispose();
     _lastAlertDelay = null;
     _lastAlert      = null;
 }
Exemple #13
0
 public static void stopAutoSync()
 {
     if (autoSyncTimer != null)
     {
         autoSyncTimer.Invalidate();
         autoSyncTimer.Dispose();
     }
 }
Exemple #14
0
 static void EndBumpingGtkLoop()
 {
     if (--bumperCount == 0)
     {
         bumperTimer.Invalidate();
         bumperTimer.Dispose();
         bumperTimer = null;
     }
 }
Exemple #15
0
        private async Task ClearClipboardTimerAsync(Tuple <string, int?, bool> data)
        {
            if (data.Item3)
            {
                return;
            }
            var clearMs = data.Item2;

            if (clearMs == null)
            {
                var clearSeconds = await _storageService.GetAsync <int?>(Constants.ClearClipboardKey);

                if (clearSeconds != null)
                {
                    clearMs = clearSeconds.Value * 1000;
                }
            }
            if (clearMs == null)
            {
                return;
            }
            if (_clipboardBackgroundTaskId > 0)
            {
                UIApplication.SharedApplication.EndBackgroundTask(_clipboardBackgroundTaskId);
                _clipboardBackgroundTaskId = 0;
            }
            _clipboardBackgroundTaskId = UIApplication.SharedApplication.BeginBackgroundTask(() =>
            {
                UIApplication.SharedApplication.EndBackgroundTask(_clipboardBackgroundTaskId);
                _clipboardBackgroundTaskId = 0;
            });
            _clipboardTimer?.Invalidate();
            _clipboardTimer?.Dispose();
            _clipboardTimer = null;
            var lastClipboardChangeCount = UIPasteboard.General.ChangeCount;
            var clearMsSpan = TimeSpan.FromMilliseconds(clearMs.Value);

            _clipboardTimer = NSTimer.CreateScheduledTimer(clearMsSpan, timer =>
            {
                Device.BeginInvokeOnMainThread(() =>
                {
                    var changeNow = UIPasteboard.General.ChangeCount;
                    if (changeNow == 0 || lastClipboardChangeCount == changeNow)
                    {
                        UIPasteboard.General.String = string.Empty;
                    }
                    _clipboardTimer?.Invalidate();
                    _clipboardTimer?.Dispose();
                    _clipboardTimer = null;
                    if (_clipboardBackgroundTaskId > 0)
                    {
                        UIApplication.SharedApplication.EndBackgroundTask(_clipboardBackgroundTaskId);
                        _clipboardBackgroundTaskId = 0;
                    }
                });
            });
        }
Exemple #16
0
 public static void Stop()
 {
     if (timer != null)
     {
         timer.Invalidate();
         timer.Dispose();
         timer = null;
     }
 }
Exemple #17
0
 public override void ViewWillUnload()
 {
     if (timer != null)
     {
         timer.Invalidate();
         timer.Dispose();
         timer = null;
     }
 }
Exemple #18
0
        // ====================================================================================================


        // ====================================================================================================
        #region MÉTODOS PRIVADOS
        // ====================================================================================================

        private void mostrarToast(string message, double seconds)
        {
            temporizador = NSTimer.CreateScheduledTimer(seconds, (obj) => {
                dialogo?.DismissViewController(true, null);
                temporizador?.Dispose();
            });
            dialogo = UIAlertController.Create(null, message, UIAlertControllerStyle.Alert);
            UIApplication.SharedApplication.KeyWindow.RootViewController.PresentViewController(dialogo, true, null);
        }
Exemple #19
0
 private void KillTimer()
 {
     if (_Timer != null)
     {
         _Timer.Invalidate();
         _Timer.Dispose();
         _Timer = null;
     }
 }
Exemple #20
0
 void MesajReddet()
 {
     if (alert != null)
     {
         alert.DismissViewController(true, null);
     }
     if (alertDelay != null)
     {
         alertDelay.Dispose();
     }
 }
        /// <summary>
        /// Stop the intermediate progress
        /// </summary>
        public void Stop()
        {
            if (_timer == null)
            {
                return;
            }

            _timer.Invalidate();
            _timer.Dispose();
            _timer = null;
        }
Exemple #22
0
 private void DismissMessage(UIAlertController alert, NSTimer alertDelay)
 {
     if (alert != null)
     {
         alert.DismissViewController(true, null);
     }
     if (alertDelay != null)
     {
         alertDelay.Dispose();
     }
 }
Exemple #23
0
 public void DismissAlert()
 {
     if (alert != null)
     {
         alert.DismissViewController(true, null);
     }
     if (alertDelay != null)
     {
         alertDelay.Dispose();
     }
 }
Exemple #24
0
 private void DismissToast()
 {
     if (alert != null)
     {
         alert.DismissViewController(true, null);
     }
     if (alertDelay != null)
     {
         alertDelay.Dispose();
     }
 }
Exemple #25
0
 void DismissMessage()
 {
     if (Alert != null)
     {
         Alert.DismissViewController(true, null);
     }
     if (Delay != null)
     {
         Delay.Dispose();
     }
 }
        public void Dismiss()
        {
            if (timer != null)
            {
                timer.Invalidate();
                timer.Dispose();
                timer = null;
            }

            SnackbarView?.Dismiss();
        }
Exemple #27
0
 void dismissMessage()
 {
     if (alert != null)
     {
         alert.DismissViewController(true, null);
     }
     if (alertDelay != null)
     {
         alertDelay.Dispose();
     }
 }
Exemple #28
0
        private static void StartTimer()
        {
            if (timer != null)
            {
                timer.Invalidate();
                timer.Dispose();
                timer = null;
            }

            timer = NSTimer.CreateRepeatingScheduledTimer(TimeSettings.SyncInterval, Sync);
        }
 public void Dispose()
 {
     try
     {
         _timer.Invalidate();
         _timer.Dispose();
     }
     catch (Exception e)
     {
         _report.Exception("MonoMacNotifier.Dispose()", e);
     }
 }
Exemple #30
0
        public void Stop()
        {
            _metronomeTimer?.Invalidate();
            _metronomeTimer?.Dispose();
            _metronomeTimer = null;
            _count          = 0;
#if DEBUG
            _testTimer.Enabled = false;
            _testMinuteCount   = 0;
#endif
            _isRunning = false;
        }