Example #1
0
        private void EnsureCountdownWindowExists()
        {
            if (_countdownWindow == null)
            {
                _countdownWindow = new CountdownWindow(_optionsService, _dateTimeService);

                if (_optionsService.Options.IsCountdownWindowTransparent &&
                    !_optionsService.Options.CountdownMonitorIsWindowed)
                {
                    _countdownWindow.AllowsTransparency = true;
                }

                _countdownWindow.TimeUpEvent += OnCountdownTimeUp;
            }
        }
Example #2
0
        public void Close()
        {
            try
            {
                if (_countdownWindow != null)
                {
                    _countdownWindow.TimeUpEvent -= OnCountdownTimeUp;
                }

                Log.Logger.Debug("Closing countdown window");

                _countdownWindow?.Close();
                _countdownWindow = null;

                BringJwlToFront();
            }
            catch (Exception ex)
            {
                Log.Logger.Error(ex, "Could not close countdown window");
            }
        }