コード例 #1
0
        /// <summary>
        /// Stops the timer, disposes off the toast messasge
        /// </summary>
        private void stopTimer()
        {
            try
            {
                unsubscribeFromHookEvents();

                if (_form != null)
                {
                    _form.Invoke(new MethodInvoker(delegate
                    {
                        if (_toastForm != null)
                        {
                            _toastForm.Close();
                            _toastForm = null;
                        }

                        if (_timer != null)
                        {
                            _timer.Stop();
                            if (EvtAutoPostionScannerStopped != null)
                            {
                                EvtAutoPostionScannerStopped(this, EventArgs.Empty);
                            }
                        }
                    }));
                }
            }
            catch
            {
            }
        }
コード例 #2
0
        /// <summary>
        /// Starts the timer that repositions the scanner on
        /// a timer tick
        /// </summary>
        public void Start()
        {
            _form.Invoke(new MethodInvoker(delegate()
            {
                _toastForm = new ToastForm("Click to stop", -1);
                Windows.SetWindowPosition(_toastForm, Windows.WindowPosition.CenterScreen);
                _toastForm.Show();

                if (!_timer.Enabled)
                {
                    subscribeToHookEvents();
                    startTimer();
                }
            }));
        }
コード例 #3
0
        /// <summary>
        /// Displays a toast message centered in the parent form.
        /// </summary>
        /// <param name="message">message to display</param>
        /// <param name="timeout">how long to display</param>
        public static void Toast(String message, int timeout = 2000)
        {
            var toast = new ToastForm(message, timeout);
            var panel = Context.AppPanelManager.GetCurrentPanel() as Form;

            toast.StartPosition = FormStartPosition.CenterParent;
            toast.ShowDialog(panel);
        }
コード例 #4
0
ファイル: AutoPositionScanner.cs プロジェクト: nbsrujan/acat
        /// <summary>
        /// Stops the timer, disposes off the toast messasge
        /// </summary>
        private void stopTimer()
        {
            try
            {
                unsubscribeFromHookEvents();

                if (_form != null)
                {
                    _form.Invoke(new MethodInvoker(delegate
                    {
                        if (_toastForm != null)
                        {
                            _toastForm.Close();
                            _toastForm = null;
                        }

                        if (_timer != null)
                        {
                            _timer.Stop();
                            if (EvtAutoPostionScannerStopped != null)
                            {
                                EvtAutoPostionScannerStopped(this, EventArgs.Empty);
                            }
                        }
                    }));
                }
            }
            catch
            {
            }
        }
コード例 #5
0
ファイル: AutoPositionScanner.cs プロジェクト: nbsrujan/acat
        /// <summary>
        /// Starts the timer that repositions the scanner on
        /// a timer tick
        /// </summary>
        public void Start()
        {
            _form.Invoke(new MethodInvoker(delegate()
            {
                _toastForm = new ToastForm("Click to stop", -1);
                Windows.SetWindowPosition(_toastForm, Windows.WindowPosition.CenterScreen);
                _toastForm.Show();

                if (!_timer.Enabled)
                {
                    subscribeToHookEvents();
                    startTimer();
                }
            }));
        }