Ejemplo n.º 1
0
        // get and return the exercise named exerciseName
        // nested in workDirectory
        public static AbstractExercise GetExercise(ExerciseAlbum workDirectory, string exerciseName)
        {
            // validate input arguments
            if (workDirectory == null ||
                exerciseName == null ||
                exerciseName == string.Empty)
            {
                throw new System.ArgumentException();
            }

            // get exercise
            AbstractExercise exercise = workDirectory.GetExercise(exerciseName);

            // validate the result
            if (exercise == null)
            {
                throw new System.Exception(
                          "this album does not contain such exercise album or exercise single!");
            }
            return(exercise);
        }
Ejemplo n.º 2
0
 // get nested exercise
 public static SortedDictionary <string, AbstractExercise> GetNestedExercise(ExerciseAlbum workDirectory)
 {
     return(workDirectory.NestedExercises);
 }
Ejemplo n.º 3
0
 // constructor: copy constructor
 public ExerciseAlbum(ExerciseAlbum othAlbum) :
     base(othAlbum.Name)
 {
     NestedExercises =
         Utils.DeepCopySortedDictionary <string, AbstractExercise>(othAlbum.NestedExercises);
 }