// 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); }
// get nested exercise public static SortedDictionary <string, AbstractExercise> GetNestedExercise(ExerciseAlbum workDirectory) { return(workDirectory.NestedExercises); }
// constructor: copy constructor public ExerciseAlbum(ExerciseAlbum othAlbum) : base(othAlbum.Name) { NestedExercises = Utils.DeepCopySortedDictionary <string, AbstractExercise>(othAlbum.NestedExercises); }