internal void AddTimerSet() { TimerSets.Add(new TimerSet() { Timers = new List <AtomicTimer>() { new AtomicTimer() { Duration = new TimeSpan(0, 0, 1) } } }); var currentTimers = TimerSets.ToList <TimerSet>(); AppCore.CurrentWorkout.Timers = currentTimers; var blub = AppCore.Workouts.Where(wo => wo.Id == this.WorkoutId).First(); blub = AppCore.CurrentWorkout; SaveTimerSets(); //{ // SetId = Guid.NewGuid().ToString(), // Name = "neues Set", // Repetitions = 1, // Timers = new List<AtomicTimer>() // { // new AtomicTimer(){Name = "Timer",Repetitions = 1, Duration = new TimeSpan(0,0,1)} // } //}); //throw new NotImplementedException(); }
public void LoadTimerSets() { //var dbMgr = new DatabaseManager(); //TODO timerSets = dbMgr.readEntry(workoutId); // hier das aktuelle set aus dem appcore.currentworkout ziehen TimerSets.Clear(); foreach (var item in AppCore.CurrentWorkout.Timers) { TimerSets.Add(item); } if (TimerSets.Count() == 0) { TimerSets.Add(new TimerSet()); //SaveTimerSets(); } }