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

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

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