public void StartStopwatch(StopwatchSettings settings)
        {
            InitializeStopwatch(settings);
            if (settings.ResetOnStart)
            {
                ResetStopwatch(settings);
            }
            var status = dicCounters[settings.StopwatchId];

            status.Start();
        }
        public void ResetStopwatch(StopwatchSettings settings)
        {
            InitializeStopwatch(settings);
            dicCounters[settings.StopwatchId].Laps.Clear();
            dicCounters[settings.StopwatchId].Reset();

            // Clear file contents
            if (settings.ClearFileOnReset)
            {
                SaveTimerToFile(settings.FileName, "");
            }
        }
        private void InitializeStopwatch(StopwatchSettings settings)
        {
            string stopwatchId = settings.StopwatchId;

            if (!dicCounters.ContainsKey(stopwatchId))
            {
                dicCounters[stopwatchId] = new StopwatchStatus();
            }

            dicCounters[stopwatchId].Filename         = settings.FileName;
            dicCounters[stopwatchId].ClearFileOnReset = settings.ClearFileOnReset;
            dicCounters[stopwatchId].LapMode          = settings.LapMode;
        }