Пример #1
0
        private void ConfigureTimingHelper()
        {
            // Start any helper
            if (Properties.Settings.Default.AutomaticNiZTimeout > 0 && _currentRaceRun != null)
            {
                _liveTimingAutoNiZ = new LiveTimingAutoNiZ(Properties.Settings.Default.AutomaticNiZTimeout, _currentRaceRun);
            }
            else if (_liveTimingAutoNiZ != null)
            {
                _liveTimingAutoNiZ.Dispose();
                _liveTimingAutoNiZ = null;
            }

            if (_liveTimingAutoNaS != null)
            {
                _liveTimingAutoNaS.Dispose();
            }
            if (_currentRaceRun != null)
            {
                _liveTimingAutoNaS = new LiveTimingAutoNaS(Properties.Settings.Default.AutomaticNaSStarters, _currentRaceRun);
            }

            if (Properties.Settings.Default.StartTimeIntervall > 0 && _currentRaceRun != null)
            {
                lblStartCountDown.Visibility = Visibility.Visible;
                _liveTimingStartCountDown    = new LiveTimingStartCountDown(Properties.Settings.Default.StartTimeIntervall, _currentRaceRun, lblStartCountDown);
            }
            else
            {
                lblStartCountDown.Visibility = Visibility.Hidden;
                _liveTimingStartCountDown.Dispose();
                _liveTimingStartCountDown = null;
            }
        }
Пример #2
0
        private void CmbRaceRun_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            CBItem  selected        = (sender as ComboBox).SelectedValue as CBItem;
            RaceRun selectedRaceRun = selected?.Value as RaceRun;


            if (_currentRaceRun != selectedRaceRun)
            {
                // Stop any helper
                if (_liveTimingAutoNiZ != null)
                {
                    _liveTimingAutoNiZ.Dispose();
                }
                _liveTimingAutoNiZ = null;

                if (_liveTimingAutoNaS != null)
                {
                    _liveTimingAutoNaS.Dispose();
                }
                _liveTimingAutoNaS = null;

                // Remember new race run
                _currentRaceRun = selectedRaceRun;

                if (_currentRaceRun != null)
                {
                    if (_dataModel.GetCurrentRace() == _currentRaceRun.GetRace())
                    {
                        _dataModel.SetCurrentRaceRun(_currentRaceRun);
                    }
                }

                ConnectUiToRaceRun(_currentRaceRun);

                ConfigureTimingHelper();
            }
        }