コード例 #1
0
ファイル: Exercise.cs プロジェクト: fr33rk/CalfTrainer
        public static Exercise ExerciseFromString(string exerciseAsString, ExerciseConfiguration configurationUsedForReset)
        {
            try
            {
                var keyValuePairFromString = GetNameValuePairsFromString(exerciseAsString);

                return(new Exercise(configurationUsedForReset)
                {
                    LongLeftCount = keyValuePairFromString[nameof(LongLeftCount)],
                    LongRightCount = keyValuePairFromString[nameof(LongRightCount)],
                    ShortLeftCount = keyValuePairFromString[nameof(ShortLeftCount)],
                    ShortRightCount = keyValuePairFromString[nameof(ShortRightCount)],
                    RemainingPreparationTime = keyValuePairFromString[nameof(RemainingPreparationTime)],
                    RemainingSubExerciseTime = keyValuePairFromString[nameof(RemainingSubExerciseTime)],
                    CurrentSubExercise = (SubExercise)keyValuePairFromString[nameof(CurrentSubExercise)]
                });
            }
            catch (Exception)
            {
                return(ExerciseFromConfiguration(configurationUsedForReset));
            }
        }
コード例 #2
0
ファイル: Exercise.cs プロジェクト: fr33rk/CalfTrainer
 public static Exercise ExerciseFromConfiguration(ExerciseConfiguration configuration)
 {
     return(new Exercise(configuration));
 }
コード例 #3
0
ファイル: Exercise.cs プロジェクト: fr33rk/CalfTrainer
 public Exercise(ExerciseConfiguration configuration)
 {
     mConfiguration = configuration;
     CalculateTotalTime();
     Reset();
 }