示例#1
0
        public void FillCollection()
        {
            ObservableCollection <string> ListOfStrings = new ObservableCollection <string>();

            var ListOfExercises = SetListOfExercises.Method();

            foreach (var exercise in ListOfExercises)
            {
                ListOfStrings.Add(exercise.Key);
            }
            ExercisesNamesCollection = ListOfStrings;
        }
示例#2
0
        public Exercise GetExerciseFromSelectedString(string pick)
        {
            Exercise exercise = new Exercise();

            var ListOfExercises = SetListOfExercises.Method();

            foreach (var item in ListOfExercises)
            {
                if (item.Key == pick)
                {
                    switch (item.Value)
                    {
                    case Enums.TypeOfExercise.Weight:
                    {
                        exercise.weightExercise      = new WeightExercise();
                        exercise.weightExercise.Name = pick;
                        break;
                    }

                    case Enums.TypeOfExercise.NoWeight:
                    {
                        exercise.noWeightExercise      = new NoWeightExercise();
                        exercise.noWeightExercise.Name = pick;
                        break;
                    }

                    case Enums.TypeOfExercise.Time:
                    {
                        exercise.timeExercise      = new TimeExercise();
                        exercise.timeExercise.Name = pick;
                        break;
                    }
                    }
                }
            }

            return(exercise);
        }