예제 #1
0
        /// <summary>
        /// Makes a shallow copy of the current DbContentClipCollection.
        /// as the parent object.
        /// </summary>
        /// <returns>DbContentClipCollection</returns>
        public DbContentClipCollection Clone()
        {
            DbContentClipCollection clonedDbContentClip = new DbContentClipCollection(count);

            lock (this)
            {
                foreach (DbContentClip item in this)
                {
                    clonedDbContentClip.Add(item);
                }
            }
            return(clonedDbContentClip);
        }
예제 #2
0
        /// <summary>
        /// Makes a deep copy of the current DbContentClip.
        /// </summary>
        /// <param name="isolation">Placeholders are used to isolate the
        /// items in the DbContentClipCollection from their children.</param>
        public DbContentClipCollection Copy(bool isolated)
        {
            DbContentClipCollection isolatedCollection = new DbContentClipCollection(count);

            lock (this)
            {
                if (isolated)
                {
                    for (int i = 0; i < count; i++)
                    {
                        isolatedCollection.Add(DbContentClipArray[i].NewPlaceHolder());
                    }
                }
                else
                {
                    for (int i = 0; i < count; i++)
                    {
                        isolatedCollection.Add(DbContentClipArray[i].Copy());
                    }
                }
            }
            return(isolatedCollection);
        }