Exemple #1
0
        /// <summary>
        /// Create configuration for running Stopwatch manager without background worker.
        /// </summary>
        /// <returns>The <see cref="StopwatchManagerConfig"/> instance.</returns>
        /// <exception cref="ConfigurationErrorsException">Using GetSection(StopwatchConfig): Error description.</exception>
        public static StopwatchManagerConfig CreateConfigWithoutBackgroundWorker()
        {
            StopwatchManagerConfig result = new StopwatchManagerConfig(true)
            {
                UseBackgroundWorker = false,
                SleepTime           = TimeSpan.Zero
            };

            return(result);
        }
Exemple #2
0
        /// <summary>
        /// Create configuration for running Stopwatch manager with background worker.
        /// </summary>
        /// <param name="sleepTime"> Sleep time that will be used in the StopwatchManager's background worker.</param>
        /// <returns>The <see cref="StopwatchManagerConfig"/> instance.</returns>
        /// <exception cref="ConfigurationErrorsException">Using GetSection(StopwatchConfig): Error description.</exception>
        public static StopwatchManagerConfig CreateBackgroundWorkerConfig(TimeSpan sleepTime)
        {
            StopwatchManagerConfig result = new StopwatchManagerConfig(true)
            {
                UseBackgroundWorker = true,
                SleepTime           = sleepTime
            };

            return(result);
        }