Exemple #1
0
        public override void AssignFromSource(object aSource)
        {
            if (!(aSource is ExerciseFilter))
            {
                throw new ArgumentException("Invalid assignment source", "ExerciseFilter");
            }

            _exerciseFilter.AssignFromSource((aSource as ExerciseFilter)._exerciseFilter);
        }
        /// <summary>
        ///    Assigns all <c>aSource</c> object's values to this instance of <see cref="ExerciseCollection"/>.
        /// </summary>
        /// <param name="aSource">A source object.</param>
        public override void AssignFromSource(object aSource)
        {
            if (!(aSource is ExerciseCollection))
            {
                throw new ArgumentException("Invalid assignment source", "ExerciseCollection");
            }

            _isFiltered     = (aSource as ExerciseCollection)._isFiltered;
            _exerciseFilter = (aSource as ExerciseCollection)._exerciseFilter;
            _exerciseList.Clear();
            foreach (Exercise vExerciseSource in (aSource as ExerciseCollection)._exerciseList)
            {
                Exercise vExerciseTarget = new Exercise();
                vExerciseTarget.AssignFromSource(vExerciseSource);
                _exerciseList.Add(vExerciseTarget);
            }
        }
        /// <summary>
        ///    Assigns all <c>aSource</c> object's values to this instance of <see cref="ExerciseCollection"/>.
        /// </summary>
        /// <param name="aSource">A source object.</param>
        public override void AssignFromSource(object aSource)
        {
            if (!(aSource is ExerciseCollection))
            {
                throw new ArgumentException("Invalid assignment source", "ExerciseCollection");
            }

            _isFiltered = (aSource as ExerciseCollection)._isFiltered;
            _exerciseFilter = (aSource as ExerciseCollection)._exerciseFilter;
            _exerciseList.Clear();
            foreach (Exercise vExerciseSource in (aSource as ExerciseCollection)._exerciseList)
            {
                Exercise vExerciseTarget = new Exercise();
                vExerciseTarget.AssignFromSource(vExerciseSource);
                _exerciseList.Add(vExerciseTarget);
            }
        }