コード例 #1
0
        private void CmbRaceRun_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            CBItem  selected        = (sender as ComboBox).SelectedValue as CBItem;
            RaceRun selectedRaceRun = selected?.Value as RaceRun;

            setRaceRun(selectedRaceRun);
        }
コード例 #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();
            }
        }