Esempio n. 1
0
        private void Countdown_Record_Click(object sender, EventArgs e)
        {
            string         saveLaps       = string.Empty;
            string         saveSplits     = string.Empty;
            StopwatchTimes stopwatchTimes = new StopwatchTimes();

            stopwatchTimes.ItemCount = CountdownTimesCollection.Count + 1;
            stopwatchTimes.SplitTime = ClockValueString;
            stopwatchTimes.LapTime   = (ClockValue - _lastSplitTime).ToString(@"hh\:mm\:ss\.ff");
            CountdownTimesCollection.Insert(0, stopwatchTimes);
            _lastSplitTime = ClockValue;

            saveSplits = GetSplitData(",");
            IS.SaveSetting("Countdown-Splits", saveSplits);

            saveLaps = GetLapData(",");
            IS.SaveSetting("Countdown-Laps", saveLaps);
        }
Esempio n. 2
0
        private void Countdown_Reset_Click(object sender, EventArgs e)
        {
            dispatcherTimer.Stop();
            MessageBoxResult result = MessageBox.Show(AppResources.ResetMessage, AppResources.ResetText, MessageBoxButton.OKCancel);

            if (result == MessageBoxResult.OK)
            {
                ResetCountdown(true);
                _lastSplitTime = new TimeSpan();
                CountdownTimesCollection.Clear();
                IS.RemoveSetting("Countdown-Laps");
                IS.RemoveSetting("Countdown-Splits");
            }
            else
            {
                dispatcherTimer.Stop();
                Mode             = AppResources.ResumeText;
                Start.Background = new SolidColorBrush(Colors.Green);
            }
        }
Esempio n. 3
0
        public void LoadLapAndSplitData()
        {
            string[] laps;
            string[] splits;

            laps   = IS.GetSettingStringValue("Countdown-Laps").Split(',');
            splits = IS.GetSettingStringValue("Countdown-Splits").Split(',');

            for (int i = laps.Count() - 1; i >= 0; i--)
            {
                if (laps[i] != string.Empty)
                {
                    StopwatchTimes stopwatchTimes = new StopwatchTimes();
                    stopwatchTimes.ItemCount = laps.Count() - i - 1;
                    stopwatchTimes.LapTime   = laps[i];
                    stopwatchTimes.SplitTime = splits[i];
                    CountdownTimesCollection.Insert(0, stopwatchTimes);

                    _lastSplitTime = TimeSpan.Parse(stopwatchTimes.SplitTime);
                }
            }
        }