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

            if (timer != null)
            {
                timer.Invalidate();
                timer.Dispose();
                timer = null;
            }
        }
コード例 #3
0
        protected override void Dispose(bool disposing)
        {
            disposed = true;
            if (beatTimer != null)
            {
                beatTimer.Dispose();
                beatTimer = null;
            }

            base.Dispose(disposing);
        }
コード例 #4
0
ファイル: AppDelegate.cs プロジェクト: turlodales/mobile
 private void StartEventTimer()
 {
     _eventTimer?.Invalidate();
     _eventTimer?.Dispose();
     _eventTimer = null;
     Device.BeginInvokeOnMainThread(() =>
     {
         _eventTimer = NSTimer.CreateScheduledTimer(60, true, timer =>
         {
             var task = Task.Run(() => _eventService.UploadEventsAsync());
         });
     });
 }
コード例 #5
0
 void hack()
 {
     try
     {
         _timer.Dispose();
         updateMeeting();
         _timer = NSTimer.CreateRepeatingScheduledTimer(TimeSpan.FromSeconds(11), hack);
     }
     catch (Exception e)
     {
         //if the semaphore is full, do nothing.
     }
 }
コード例 #6
0
 /// <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);
        }
コード例 #8
0
        //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        public override void ViewWillDisappear(bool animated)
        {
            base.ViewWillDisappear(animated);

            timer.Invalidate();
            timer.Dispose();
        }
コード例 #9
0
 public void Reset()
 {
     inactivityTimer.Invalidate();
     inactivityTimer.Dispose();
     inactivityTimer         = NSTimer.CreateScheduledTimer(TimeSpan.FromSeconds(AppConstant.InactivityTimeOut), InActivityTimer_Elapsed);
     lastActivityElapsedTime = NSProcessInfo.ProcessInfo.SystemUptime;
 }
コード例 #10
0
        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();
                    });
                });
            };
        }
コード例 #11
0
 private void StopTimer()
 {
     if (mTimer != null)
     {
         mTimer.Dispose();
         mTimer = null;
     }
 }
コード例 #12
0
 void DismissMessage(UIAlertController alert, NSTimer alertDelay, Action complete)
 {
     alert?.DismissViewController(true, complete);
     alert?.Dispose();
     alertDelay?.Dispose();
     _lastAlertDelay = null;
     _lastAlert      = null;
 }
コード例 #13
0
 public static void stopAutoSync()
 {
     if (autoSyncTimer != null)
     {
         autoSyncTimer.Invalidate();
         autoSyncTimer.Dispose();
     }
 }
コード例 #14
0
ファイル: MDMenu.cs プロジェクト: noah1510/dotdevelop
 static void EndBumpingGtkLoop()
 {
     if (--bumperCount == 0)
     {
         bumperTimer.Invalidate();
         bumperTimer.Dispose();
         bumperTimer = null;
     }
 }
コード例 #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;
                    }
                });
            });
        }
コード例 #16
0
 public static void Stop()
 {
     if (timer != null)
     {
         timer.Invalidate();
         timer.Dispose();
         timer = null;
     }
 }
コード例 #17
0
 public override void ViewWillUnload()
 {
     if (timer != null)
     {
         timer.Invalidate();
         timer.Dispose();
         timer = null;
     }
 }
コード例 #18
0
ファイル: DialogService.cs プロジェクト: ander74/Quattro2
        // ====================================================================================================


        // ====================================================================================================
        #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);
        }
コード例 #19
0
ファイル: Wait.cs プロジェクト: drony/MonoMobile.Views
 private void KillTimer()
 {
     if (_Timer != null)
     {
         _Timer.Invalidate();
         _Timer.Dispose();
         _Timer = null;
     }
 }
コード例 #20
0
ファイル: ToastService.cs プロジェクト: girish66/XamStart
 void MesajReddet()
 {
     if (alert != null)
     {
         alert.DismissViewController(true, null);
     }
     if (alertDelay != null)
     {
         alertDelay.Dispose();
     }
 }
コード例 #21
0
        /// <summary>
        /// Stop the intermediate progress
        /// </summary>
        public void Stop()
        {
            if (_timer == null)
            {
                return;
            }

            _timer.Invalidate();
            _timer.Dispose();
            _timer = null;
        }
コード例 #22
0
 private void DismissMessage(UIAlertController alert, NSTimer alertDelay)
 {
     if (alert != null)
     {
         alert.DismissViewController(true, null);
     }
     if (alertDelay != null)
     {
         alertDelay.Dispose();
     }
 }
コード例 #23
0
 public void DismissAlert()
 {
     if (alert != null)
     {
         alert.DismissViewController(true, null);
     }
     if (alertDelay != null)
     {
         alertDelay.Dispose();
     }
 }
コード例 #24
0
ファイル: ToastiOS.cs プロジェクト: LahiruKaushalya/NotifyMe
 private void DismissToast()
 {
     if (alert != null)
     {
         alert.DismissViewController(true, null);
     }
     if (alertDelay != null)
     {
         alertDelay.Dispose();
     }
 }
コード例 #25
0
 void DismissMessage()
 {
     if (Alert != null)
     {
         Alert.DismissViewController(true, null);
     }
     if (Delay != null)
     {
         Delay.Dispose();
     }
 }
コード例 #26
0
        public void Dismiss()
        {
            if (timer != null)
            {
                timer.Invalidate();
                timer.Dispose();
                timer = null;
            }

            SnackbarView?.Dismiss();
        }
コード例 #27
0
 void dismissMessage()
 {
     if (alert != null)
     {
         alert.DismissViewController(true, null);
     }
     if (alertDelay != null)
     {
         alertDelay.Dispose();
     }
 }
コード例 #28
0
ファイル: SyncView.cs プロジェクト: MetroStar/eBriefingiOS
        private static void StartTimer()
        {
            if (timer != null)
            {
                timer.Invalidate();
                timer.Dispose();
                timer = null;
            }

            timer = NSTimer.CreateRepeatingScheduledTimer(TimeSettings.SyncInterval, Sync);
        }
コード例 #29
0
 public void Dispose()
 {
     try
     {
         _timer.Invalidate();
         _timer.Dispose();
     }
     catch (Exception e)
     {
         _report.Exception("MonoMacNotifier.Dispose()", e);
     }
 }
コード例 #30
0
ファイル: Metronome.cs プロジェクト: nwestfall/clad
        public void Stop()
        {
            _metronomeTimer?.Invalidate();
            _metronomeTimer?.Dispose();
            _metronomeTimer = null;
            _count          = 0;
#if DEBUG
            _testTimer.Enabled = false;
            _testMinuteCount   = 0;
#endif
            _isRunning = false;
        }