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