public static void Stop(this IHasRunning obj, DateTime time) { if (obj.IsRunning) { obj.StopTime = time; obj.IsRunning = false; } }
public static void Start(this IHasRunning obj, DateTime time) { if (!obj.IsRunning) { obj.StartTime = time; obj.StopTime = Constants.DefaultUtcDate; obj.IsRunning = true; } }