Пример #1
0
 private static void WriteWorkoutList(IList <Workout> workouts)
 {
     if (workouts != null)
     {
         File.WriteAllText(WorkoutFile, ListConverter.ConvertListToString(workouts));
     }
 }
Пример #2
0
        public static List <Workout> GetWorkoutList()
        {
            if (!File.Exists(WorkoutFile))
            {
                return(new List <Workout>());
            }
            var workouts = File.ReadAllText(WorkoutFile);

            return(ListConverter.ConvertStringToList <Workout>(workouts) ?? new List <Workout>());
        }