/// <summary> /// Makes a shallow copy of the current DojoTestListCollection. /// as the parent object. /// </summary> /// <returns>DojoTestListCollection</returns> public DojoTestListCollection Clone() { DojoTestListCollection clonedDojoTestList = new DojoTestListCollection(count); lock (this) { foreach (DojoTestList item in this) { clonedDojoTestList.Add(item); } } return(clonedDojoTestList); }
/// <summary> /// Makes a deep copy of the current DojoTestList. /// </summary> /// <param name="isolation">Placeholders are used to isolate the /// items in the DojoTestListCollection from their children.</param> public DojoTestListCollection Copy(bool isolated) { DojoTestListCollection isolatedCollection = new DojoTestListCollection(count); lock (this) { if (isolated) { for (int i = 0; i < count; i++) { isolatedCollection.Add(DojoTestListArray[i].NewPlaceHolder()); } } else { for (int i = 0; i < count; i++) { isolatedCollection.Add(DojoTestListArray[i].Copy()); } } } return(isolatedCollection); }