Ejemplo n.º 1
0
 private void TextBoxTime_OnSelectionChanged(object sender, RoutedEventArgs e)
 {
     if (IsRunning && TextBoxTime.SelectionLength != 0)
     {
         TextBoxTime.Select(0, 0);
     }
 }
Ejemplo n.º 2
0
        private void TextBoxTime_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            DisplayTotalTime = !DisplayTotalTime;

            var timeElapsed = DisplayTotalTime ? TotalTimeElapsed : _stopwatch.Elapsed;
            var oneDay      = new TimeSpan(1, 0, 0, 0, 0);

            if (timeElapsed < oneDay)
            {
                _elapsedTimeFormat = TimeFormats.Default;
                _longIntervalPassTimer.Interval = oneDay.Subtract(timeElapsed);
            }
            else
            {
                _elapsedTimeFormat = TimeFormats.Long;
            }

            if (!IsRunning)
            {
                TextBoxTime.Text = ElapsedTimeString;
            }
            TextBoxTime.Select(0, 0);
        }