Sanguosha.UI.Controls.TwoSidesCardChoiceBox.StartCountDown C# (CSharp) Méthode

StartCountDown() public méthode

public StartCountDown ( bool isMainPlayer, int timeOutSeconds ) : void
isMainPlayer bool
timeOutSeconds int
Résultat void
        public void StartCountDown(bool isMainPlayer, int timeOutSeconds)
        {
            ProgressBar progressBar = isMainPlayer ? progressBar1 : progressBar2;

            if (timeOutSeconds == 0)
            {
                progressBar.Visibility = System.Windows.Visibility.Hidden;
                progressBar.BeginAnimation(ProgressBar.ValueProperty, null);
            }
            else
            {
                progressBar.Visibility = System.Windows.Visibility.Visible;
                progressBar.Opacity = 1.0d;

                Duration duration = new Duration(TimeSpan.FromSeconds(timeOutSeconds));
                DoubleAnimation doubleanimation = new DoubleAnimation(100d, 0d, duration);
                progressBar.BeginAnimation(ProgressBar.ValueProperty, doubleanimation);

            }
        }