Ejemplo n.º 1
0
        /// <summary>
        /// Removes the given entry from this collection. Returns true if the member has been
        /// removed, or false otherwise.
        /// </summary>
        /// <param name="entry">The entry to remove.</param>
        /// <returns>True if the entry has been removed, or false otherwise.</returns>
        public bool Remove(MapMember <T> entry)
        {
            if (IsDisposed)
            {
                throw new ObjectDisposedException(this.ToString());
            }
            if (Map.IsDisposed)
            {
                throw new ObjectDisposedException(Map.ToString());
            }
            if (Map.IsValidated)
            {
                throw new InvalidOperationException("Map '{0}' is validated.".FormatWith(Map));
            }

            bool r = entry == null ? false : _List.Remove(entry);

            if (r)
            {
                entry.OnDispose();
            }
            return(r);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns a new instance that is a copy of the original one, but associated with
        /// the given target.
        /// </summary>
        /// <param name="target">The target the new instance with be associated with.</param>
        /// <returns>A new instance.</returns>
        internal MapMember <T> Clone(DataMap <T> target)
        {
            var cloned = new MapMember <T>(target, Name); OnClone(cloned);

            return(cloned);
        }