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

            _isFiltered = (aSource as WorkoutCollection)._isFiltered;
            _workoutFilter = (aSource as WorkoutCollection)._workoutFilter;
            _workoutList.Clear();
            foreach (Workout vWorkoutSource in (aSource as WorkoutCollection)._workoutList)
            {
                Workout vWorkoutTarget = new Workout();
                vWorkoutTarget.AssignFromSource(vWorkoutSource);
                _workoutList.Add(vWorkoutTarget);
            }
        }
示例#2
0
        /// <summary>
        ///    Assigns all <c>aSource</c> object's values to this instance of <see cref="WorkoutCollection"/>.
        /// </summary>
        /// <param name="aSource">A source object.</param>
        public override void AssignFromSource(object aSource)
        {
            if (!(aSource is WorkoutCollection))
            {
                throw new ArgumentException("Invalid assignment source", "WorkoutCollection");
            }

            _isFiltered    = (aSource as WorkoutCollection)._isFiltered;
            _workoutFilter = (aSource as WorkoutCollection)._workoutFilter;
            _workoutList.Clear();
            foreach (Workout vWorkoutSource in (aSource as WorkoutCollection)._workoutList)
            {
                Workout vWorkoutTarget = new Workout();
                vWorkoutTarget.AssignFromSource(vWorkoutSource);
                _workoutList.Add(vWorkoutTarget);
            }
        }