/// <summary> /// Constructor for Simple Data /// </summary> public BlindTimerWindow(TimeSpan blindTime, BlindLevel currentLevel) { InitializeComponent(); BlindTime = blindTime; _currentLevel = currentLevel; _uiUpdater = new DispatcherTimer { Interval = new TimeSpan(0, 0, 1) }; //Create the UiUpdater _uiUpdater.Tick += UiUpdater_Tick; _blindTimer = new DispatcherTimer { Interval = blindTime }; _blindTimer.Tick += BlindTimer_Tick; }
private void BlindTimer_Tick(object sender, EventArgs e) { _blindTimer.Stop(); _secondsPassed = 0; if (_nextLevel != null) { _currentLevel = _nextLevel; } _nextLevel = _currentTournament?.TournamentStructure.GetNextLevel(_currentLevel); _blindTimer.Start(); //PlayNextLevelSound throw new NotImplementedException(); }
private void AddBlindButton_Click(object sender, RoutedEventArgs e) { var addLevel = new BlindLevel(); if (!int.TryParse(BigBlindBox.Text, out addLevel.BigBlind) || !int.TryParse(SmallBlindBox.Text, out addLevel.SmallBlind)) { return; } if (CurrentBlindsDisplayed.Any(x => x.SmallBlind == addLevel.BigBlind)) { return; } int.TryParse(AnteBox.Text, out addLevel.Ante); CurrentBlindsDisplayed.Add(addLevel); CurrentBlindsDisplayed.Sort(); BlindsListBox.ItemsSource = CurrentBlindsDisplayed; }
/// <summary> /// /// </summary> /// <param name="nextLevel"></param> public void SetNextBlindLevel(BlindLevel nextLevel) { _nextLevel = nextLevel; }