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); }
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); } } }