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

            _isFiltered = (aSource as FriendCollection)._isFiltered;
            _friendFilter = (aSource as FriendCollection)._friendFilter;
            _friendList.Clear();
            foreach (Friend vFriendSource in (aSource as FriendCollection)._friendList)
            {
                Friend vFriendTarget = new Friend();
                vFriendTarget.AssignFromSource(vFriendSource);
                _friendList.Add(vFriendTarget);
            }
        }
Пример #2
0
        /// <summary>
        ///    Assigns all <c>aSource</c> object's values to this instance of <see cref="FriendCollection"/>.
        /// </summary>
        /// <param name="aSource">A source object.</param>
        public override void AssignFromSource(object aSource)
        {
            if (!(aSource is FriendCollection))
            {
                throw new ArgumentException("Invalid assignment source", "FriendCollection");
            }

            _isFiltered   = (aSource as FriendCollection)._isFiltered;
            _friendFilter = (aSource as FriendCollection)._friendFilter;
            _friendList.Clear();
            foreach (Friend vFriendSource in (aSource as FriendCollection)._friendList)
            {
                Friend vFriendTarget = new Friend();
                vFriendTarget.AssignFromSource(vFriendSource);
                _friendList.Add(vFriendTarget);
            }
        }